microsoft / microsoft/TypeScript-TmLanguage
typescript type textMate scopes highlighting error
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
- 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.
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