microsoft / microsoft/TypeScript-TmLanguage

Unexpected coloring of the token in the editor

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

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

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

説明

While examining code in the diff editor, I noticed that the color schema appears to be off. Notice how in the following image, the this token on line 322 is colored green while it should actually be a dark blue (like the other this tokens).

Screenshot 2023-08-25 at 14 22 40

I was using the following code:

Code

private _renderFoldingIconForLine(container: HTMLSpanElement, foldingModel: FoldingModel | null | undefined, index: number, line: number): FoldingIcon | undefined {
   const showFoldingControls: 'mouseover' | 'always' | 'never' = 
   this._editor.getOption(EditorOption.showFoldingControls);
   if (!foldingModel || showFoldingControls === 'never') {
      return;
   }
   const foldingRegions = foldingModel.regions;
   const indexOfFoldingRegion = foldingRegions.findRange(line);
   const startLineNumber = foldingRegions.getStartLineNumber(indexOfFoldingRegion);
   const isFoldingScope = line === startLineNumber;
   if (!isFoldingScope) {
      return;
   }
   const foldingIconNode = container.appendChild(document.createElement('div'));
   const isCollapsed = foldingRegions.isCollapsed(indexOfFoldingRegion);
   foldingIconNode.className = ThemeIcon.asClassName(isCollapsed ? foldingCollapsedIcon : foldingExpandedIcon);
   const foldingIcon = new FoldingIcon(foldingIconNode, isCollapsed);
   foldingIcon.setVisible(isCollapsed || showFoldingControls === 'always');
   foldingIcon.setTransitionRequired(true);

   this._foldingIconStore.add(dom.addDisposableListener(foldingIconNode, dom.EventType.CLICK, () => {
	toggleCollapseState(foldingModel, Number.MAX_VALUE, [line]);
	foldingIcon.isCollapsed = !isCollapsed;
	const scrollTop = (
		isCollapsed ?
			this._editor.getTopForLineNumber(startLineNumber)
			: this._editor.getTopForLineNumber(foldingRegions.getEndLineNumber(indexOfFoldingRegion)))
		- this._lineHeight * index + 1;
	this._editor.setScrollTop(scrollTop);
   }));
   return foldingIcon;
}

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

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

はじめの一歩

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

調査の方向性

提供された TypeScript スニペットとスクリーンショットを使って VS Code の差分エディターの色付けを再現し、その後、影響を受ける this トークンについて TypeScript TextMate グラマーとトークン スコープを調べます。そのトークンが他の this トークンと同じ濃い青色で色付けされれば、Issue は完了です。

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

評価

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

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

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