microsoft / microsoft/TypeScript-TmLanguage
Messed syntax highlighting
オープン
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 471
- フォーク
- 149
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Does this issue occur when all extensions are disabled? ✔️
- VS Code Version: 1.56.2
- OS Version: Windows 10
- Language: TypeScript
Description:
- When a type declaration statement without an ending semicolon is followed directly by some specific statement, like a function call, the syntax highlighting of the following codes becomes messed up. If we add a semicolon at the end, or a blank line, the syntax highlighting will return to normal. Though this bug could be easily avoided by users, I still recommend it be fixed, since syntax highlighting should always synchronize with compilers, and such codes can be successfully compiled by tsc.
How to Reproduce:
- Copy the following snippet into VS Code
async function foo(): Promise<number> { return Promise.resolve(0); } type Type = string foo().then(async bar => { if (typeof (bar) == "number") console.log("number"); const year = 2021; }); - Check out the syntax highlighting, it should be something like the following image:

コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、拡張機能を無効にした状態で VS Code 1.56.2 に報告されたスニペットを再現し、セミコロンまたは空行がある場合とない場合でハイライトを比較します。ペイロードにはソースファイルもテストも指定されていません。宣言にセミコロンがない場合でも、TypeScript 文法によって後続のコードが正しくハイライトされ続ければ完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100