microsoft / microsoft/TypeScript-TmLanguage
Syntax highlighting: generic type arguments are highly affected by whitespace and other irrelevant context
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 471
- Fork
- 149
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
🔎 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
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dai file della grammatica TypeScript TextMate presenti in questo repository e riproduci l'esempio Playground in VS Code usando lo schema di colori Monokai Pro. Confronta gli argomenti di tipo generico nelle variazioni di spazi bianchi e contesto circostante mostrate nell'issue. Il lavoro è completato quando gli identificatori, le parentesi angolari, le parentesi tonde, gli argomenti di tipo e gli argomenti numerici elencati ricevono un'evidenziazione coerente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100