microsoft / microsoft/TypeScript-TmLanguage

Javascript highlighting fails when less than symbol ("<") is first char and followed by greater than (">")

Abierto
#884 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Accepting PRs bug javascript
Lenguaje dominante
TypeScript
Estrellas
471
Forks
149
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

TS and JS Grammar Extension version: clicking previous link (in chrome 91.0.4472.114 on macos 10.13.6) gives 404 but searching vscode 1.59.1 extensions for @builtin typescript shows vscode.typescript-language-features 1.0.0 and vscode.typescript 1.0.0. Installing ms-vscode.vscode-typescript-next 4.5.20210902, found in this repo's readme, made no difference.

Code

vscode language mode: JavaScript

const x = 1;
0
< x
&& 1 > 0 // incorrect syntax highlight color coding

Screen Shot 2021-09-03 at 17 54 05

The issue seems to be that < x … > is interpreted as some type specification (like in array<int>)?
Compare with following where the last x is replaced with 1.

const x = 1;
0
< 1
&& 1 > 0 // correct syntax highlight color coding

Screen Shot 2021-09-03 at 17 55 02


I found #752 but decided to open a new issue.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Start with the JavaScript grammar behavior for the reproduced < x and && 1 > 0 expression, then compare it with the numeric variant in the issue. Review the related #752 issue and the grammar files in this repository to identify the relevant rule. Done means both examples receive correct JavaScript syntax highlighting.

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
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.