microsoft / microsoft/TypeScript-TmLanguage
Syntax highlighting: generic type arguments are highly affected by whitespace and other irrelevant context
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 471
- Forks
- 149
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
🔎 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
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit den TypeScript-TextMate-Grammatikdateien in diesem Repository und reproduziere das Playground-Beispiel in VS Code mit dem Farbschema Monokai Pro. Vergleiche generische Typargumente über die im Issue gezeigten Variationen bei Leerraum und umgebendem Kontext hinweg. Als abgeschlossen gilt, dass die aufgeführten Bezeichner, spitzen Klammern, Klammern, Typargumente und numerischen Argumente eine konsistente Hervorhebung erhalten.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- typescript
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100