microsoft / microsoft/TypeScript-TmLanguage
Bad syntax Highlighting in TS when using multiline union types
オープン
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 471
- フォーク
- 149
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
Does this issue occur when all extensions are disabled?: Yes/No
- VS Code Version: 1.95.3
- OS Version: MacOS 15.0.1
Steps to Reproduce:
Write the following in VSCode
let myObj:
| {
prop1: string
}
| {
prop2: string
}
function myFunc() {}
The syntax of function myFunc() {} and everything after it is broken.
I found that it happens only in this rare edge case. Some things that actually fix it:
- Adding a semicolon
let myObj:
| {
prop1: string
}
| {
prop2: string
};
function myFunc() {}
- Writing the union type on a single line
let myObj: { prop1: string } | { prop2: string }
function myFunc() {}
- Adding a line break before the next line of code
let myObj:
| {
prop1: string
}
| {
prop2: string
}
function myFunc() {}
Bad highlighting:
Wanted highlighting:
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
VS Code で TypeScript のスニペットを再現し、リポジトリの TextMate 文法ファイルを調べて、複数行のユニオン型の処理箇所を特定します。セミコロンや余分な空行を必要とせず、次の関数が正しくハイライトされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100