microsoft / microsoft/TypeScript-TmLanguage

typescript type textMate scopes highlighting error

Open
#997 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
471
Forks
149
PR merge metrics
No merged PRs in 30d

Description

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.84.1
  • OS Version: macOS 14.0

I have the following TypeScript code, and its return type is a union type. However, the colors for syntax highlighting are inconsistent in the same location (data and arg). I found that this is due to their different TextMate scopes.

declare function getCb():
  | { data: string; cb: (arg: string) => void }
  | { data: number; cb: (arg: number) => void }

like :
图片
scopes :
图片
图片

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided union-type snippet in VS Code 1.84.1 on macOS and inspect the TextMate scopes shown in the report. Trace the TypeScript TextMate grammar rules that classify data, arg, and their types; done means equivalent constructs receive consistent syntax highlighting without changing unrelated TypeScript scopes.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.