microsoft / microsoft/TypeScript-TmLanguage

Messed syntax highlighting

オープン
#873 コメント 6 件 リアクション 6 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
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:
  1. 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;
    });
    
  2. Check out the syntax highlighting, it should be something like the following image:
    2021-05-24 182845

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、拡張機能を無効にした状態で VS Code 1.56.2 に報告されたスニペットを再現し、セミコロンまたは空行がある場合とない場合でハイライトを比較します。ペイロードにはソースファイルもテストも指定されていません。宣言にセミコロンがない場合でも、TypeScript 文法によって後続のコードが正しくハイライトされ続ければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。