microsoft / microsoft/TypeScript-TmLanguage
Syntax highlighting: generic type arguments are highly affected by whitespace and other irrelevant context
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- TypeScript
- Estrellas
- 471
- Forks
- 149
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
🔎 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
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con los archivos de gramática TypeScript TextMate de este repositorio y reproduce el ejemplo de Playground en VS Code usando el esquema de color Monokai Pro. Compara los argumentos de tipo genérico en las variaciones de espacios en blanco y contexto circundante mostradas en el issue. Se considera terminado cuando los identificadores, corchetes angulares, paréntesis, argumentos de tipo y argumentos numéricos indicados reciben un resaltado coherente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- typescript
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100