Unexpected coloring of the token in the editor
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- tooling
Research direction
Reproduce the coloring in the VS Code diff editor using the supplied TypeScript snippet and screenshot, then inspect the TypeScript TextMate grammar and token scopes for the affected this token. The issue is done when that token receives the same dark-blue coloring as the other this tokens.
Written by the indexing model from the issue text.
Description
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).
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;
}
- Dominant language
- TypeScript
- Stars
- 471
- Forks
- 149
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/TypeScript-TmLanguage
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/TypeScript-TmLanguage#1071 ·
-
triste Open
Difficulty 5/5 Over a week Newbie friendliness 5/100
microsoft/TypeScript-TmLanguage#1078 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
microsoft/TypeScript-TmLanguage#1076 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
microsoft/TypeScript-TmLanguage#1074 · 2 comments ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 58/100
microsoft/TypeScript-TmLanguage#1066 · 1 comment ·
All issues in microsoft/TypeScript-TmLanguage
Similar issues
-
clawsweeper:linked-pr-open clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:message-loss issue-rating: 🦞 diamond lobster maturity:stable P2
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#616 ·
-
ZCode 3.14.3 に対応する Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
supermomonga/zcode-acp#24 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
growthbook/growthbook#7100 ·
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100