microsoft / microsoft/TypeScript-TmLanguage

The trailing newline character in line comments is not properly scoped

オープン
#810 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
TypeScript
スター
471
フォーク
149
PR マージ指標
30日以内にマージされた PR はありません

説明

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.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、行コメントに scope を付ける TypeScript の TextMate 文法ルールを特定し、その後、終端の改行の扱いを報告されている Sublime Text の挙動と比較します。改行が行コメントの一部として scope され、リポジトリの説明に記載されたエディターのサポートが維持されていれば完了です。issue ではテストファイルは特定されていません。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。