Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Syntax highlighting broken in lambda after type statement without semicolon

未關閉
#889 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
38/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
停滯
技術堆疊
typescript
領域
devtools, tooling

研究方向

開啟連結的 TypeScript Playground,使用提供的 lambda 和型別宣告,在 VS Code 1.61.2 中重現醒目提示差異。檢查 TextMate grammar 的行為,以及沒有分號的型別陳述式周圍的 scope/token 輸出。當 type 和 const 在 lambda 內外獲得相同的醒目提示,且不需要分號時,即表示完成。

由索引模型根據 Issue 內容生成。

描述

Bug Report

🔎 Search Terms

syntax highlight semicolon lambda

🕗 Version & Regression Information
  • This is not a bug with the compiler
  • This is a VSCode syntax highlighting bug
  • VSCode Version 1.61.2
Version: 1.61.2 (user setup)
Commit: 6cba118ac49a1b88332f312a8f67186f7f3c1643
Date: 2021-10-19T14:57:20.575Z
Electron: 13.5.1
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043
⏯ Playground Link

Playground link with relevant code

💻 Code
declare function doFoo(arg: any): void

type A = number
doFoo(() => {
    type B = number
    const b = 5
})
const a = 1
🙁 Actual behavior

type and const get colored oddly inside the lambda.

image

Notice that the colors are different in and out of the lambda.

Scope/token debugging:

image

🙂 Expected behavior

The syntax highlighting should look like this:

image

Notice that colors are the same in and out of the lambda. I added a semicolon in this case to the type statement to workaround the issue.

Scope/token debugging:

image

主要語言
TypeScript
星號
471
分支
149
PR 合併指標
30 天內沒有已合併 PR

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

microsoft/TypeScript-TmLanguage 的其他 Issue

查看 microsoft/TypeScript-TmLanguage 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。