microsoft / microsoft/TypeScript-TmLanguage

The trailing newline character in line comments is not properly scoped

Aperta
#810 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

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

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia individuando la regola della grammatica TextMate di TypeScript che assegna lo scope ai commenti di riga, quindi confronta la gestione del carattere di nuova riga terminante con il comportamento segnalato di Sublime Text. Il lavoro è completato quando il carattere di nuova riga è sottoposto a scope come parte del commento di riga, preservando al contempo il supporto per gli editor nominati nella descrizione del repository; nell’issue non è identificato alcun file di test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.