microsoft / microsoft/TypeScript-TmLanguage
The trailing newline character in line comments is not properly scoped
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
TypeScript Sublime Package version: 3.8.2
As the syntax currently stands, the newline character that terminates a line comment is not scoped as being a part of the comment body itself. This causes various issues in Sublime Text in particular, although not being familiar with the other editors that are also using this syntax I'm not sure if there's a reason why this is the case or not.
For example, in Sublime the auto_complete_selector setting is used to control in what circumstances the autocompletion popup will automatically trigger. The general practice is to include source - comment in this setting to stop autocompletion from happening inside of a comment, since that is rarely useful. Since the newline isn't scoped, the autocomplete popup triggers constantly while entering comments.
In addition, various plugins and commands attempt to continue comments onto the next line when pressing enter, which generally requires that the end of the current comment be scoped as a comment so as to be syntax agnostic.
In order to support this for TypeScript, extra key bindings or plugin logic to try and detect that the current position is the end of a line comment are required, which arguably is information that the syntax should be providing.
As indicated above, since I'm purely a Sublime user I'm not sure if the other editors targeted by this syntax don't exhibit such issues or if there's some other reason why the newline is not currently being scoped as a comment.
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 localizando la regla de gramática de TextMate de TypeScript que asigna el scope a los comentarios de línea y, después, compara cómo trata el salto de línea terminador con el comportamiento reportado de Sublime Text. Se considera terminado cuando el salto de línea tiene el scope como parte del comentario de línea, manteniendo al mismo tiempo la compatibilidad con los editores mencionados en la descripción del repositorio; en el issue no se identifica ningún archivo de prueba.
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