microsoft / microsoft/TypeScript-TmLanguage
VSCode Syntax highlighting broken when using nullish coalescing operator in jsx
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 471
- Forks
- 149
- PR merge metrics
- No merged PRs in 30d
Description
TS and JS Grammar Extension version: 0.0.55 / latest
Not a big deal, but in vscode, syntax highlighting breaks when using nullish coalescing operator in jsx. See how the closing tags after the null coalescing operators /> change of color (white, then reddish) :

When the correct highlighting should be :

Code example:
<InfoTooltip title={tooltip ?? ''}>
<MenuItem>
<ListItemIcon>
<Icon fontSize="small" />
</ListItemIcon>
<ListItemText primary={label ?? <Component ref={clickRef} />} />
</MenuItem>
</InfoTooltip>
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 JSX example in VS Code with the TypeScript and JavaScript Grammar Extension, then inspect the TypeScript-TmLanguage grammar files that classify nullish coalescing expressions. Done means closing JSX tags after nullish coalescing operators retain the same correct highlighting shown in the expected example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100