Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Generic constructor with more than one generic type can break syntax highlighting.

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

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

評価

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

調査の方向性

ソースファイルもテストも指定されていません。まず issue にある複数行の TypeScript ジェネリックコンストラクターの例を再現し、動作するバリアントと比較して、構文ハイライトを担っている TypeScript TextMate 文法を追跡してください。示されたコードとその周囲のファイルで正しいハイライトが維持されれば完了です。

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

説明

JavaScript and TypeScript Nightly version:

Last released - 4/4/2023, 02:09:37
Last updated - 4/4/2023, 18:09:42

Code

export class Foo {
    readonly bar = {
        map: new Map<
            Type1, Type2>([]) 
    };

    private function() {
        return 1;
    }
}

The code above breaks syntax highlighting, I have also tested in insiders vscode with nightly typescript.

image

It is fine, if both generics are on the same line as the main type:

image

If there is only 1 generic, it does slightly better, the highlighting of the generic is wrong, but the rest of the file is ok.

image

Or if the argument to the constructor is not a list, this it is also recoverable, although both the highlighting of the generic, and the closing angle bracket are wrong.

image

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

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

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

はじめの一歩

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

microsoft/TypeScript-TmLanguage のほかの issue

microsoft/TypeScript-TmLanguage の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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