microsoft / microsoft/TypeScript-TmLanguage

Syntax highlighting broken in lambda after type statement without semicolon

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

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

主要言語
TypeScript
スター
471
フォーク
149
PR マージ指標
30日以内にマージされた PR はありません

説明

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

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

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

はじめの一歩

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

調査の方向性

リンクされている TypeScript Playground を開き、提供された lambda と型宣言を使って VS Code 1.61.2 でのハイライトの違いを再現します。TextMate grammar の動作と、セミコロンのない type 文の周辺の scope/token 出力を調べます。type と const が lambda の内外で同じハイライトを受け、セミコロンを必要としない状態になれば完了です。

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

評価

技術スタック
typescript
領域
devtools, tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
38/100

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

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