microsoft / microsoft/TypeScript-TmLanguage

The trailing newline character in line comments is not properly scoped

Offen
#810 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
TypeScript
Sterne
471
Forks
149
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die TypeScript-TextMate-Grammatikregel zu lokalisieren, die Zeilenkommentare scoped, und vergleiche dann ihre Behandlung des abschließenden Zeilenumbruchs mit dem berichteten Verhalten von Sublime Text. Die Aufgabe ist erledigt, wenn der Zeilenumbruch als Teil des Zeilenkommentars gescoped wird und gleichzeitig die Unterstützung für die in der Repository-Beschreibung genannten Editoren erhalten bleibt; im Issue ist keine Testdatei angegeben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.