microsoft / microsoft/TypeScript-TmLanguage
Syntax highlighting: generic type arguments are highly affected by whitespace and other irrelevant context
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 471
- フォーク
- 149
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
🔎 Search Terms
syntax highlighting generics
🕗 Version & Regression Information
This is the behavior in every version I tried, and I reviewed the FAQ for entries about syntax highlighting and generics.
⏯ Playground Link
💻 Code
declare function abc<A, B, C>(): unknown
const abc2 = abc<1, 2, 3>
const abc3 = abc<X, Y, Z>
const abc4 = abc<
1,
2,
3
>
const abc5 = abc<
X,
Y,
Z
>
const result1 = abc<1, 2, 3>()
const result2 = abc<
1,
2,
3
>()
const result3 = abc<X, Y, Z>()
const result4 = abc<
X,
Y,
Z
>()
const arr = [
abc<1, 2, 3>(),
abc<
1,
2,
3
>(),
abc<X, Y, Z>(),
abc<
X,
Y,
Z
>(),
]
const obj = {
result1: abc<1, 2, 3> (),
result2: abc<
1,
2,
3
>(),
result3: abc<X, Y, Z>(),
result4: abc<
X,
Y,
Z
>(),
}
🙁 Actual behavior
Declaring a function signature with generics seems to be pretty robust to changes in whitespace and surrounding context, but passing type arguments is extremely brittle.
This is the preceding code sample in VS Code with the Monokai Pro color scheme:
🙂 Expected behavior
Consistent syntax highlighting:
abcto be consistently green (3/16)<>to be consistently gray (3/16)()to be consistently gray (8/12)X,Y,Zto be consistently blue (3/8)1,2,3to be consistently purple (6/8)
Additional information about the issue
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
このリポジトリの TypeScript TextMate grammar files から始め、Monokai Pro color scheme を使用して VS Code で Playground example を再現します。issue に示されている空白と周囲のコンテキストの各バリエーションについて、ジェネリック型引数を比較します。完了の条件は、記載された識別子、山括弧、括弧、型引数、数値引数が一貫してハイライトされることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100