Typescript syntax highlighting: Problem with JSDoc comments with JSON inside `@default` tag
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- tooling
Research direction
Reproduce the TypeScript syntax-highlighting issue using the JSDoc example in the report, then inspect the grammar entry points that classify @default tags and JSON-like braces. The work is done when the opening brace in the JSON value is highlighted as part of the tag value rather than as code, with relevant grammar tests updated if the repository provides them.
Written by the indexing model from the issue text.
Description
Type: Bug
When entering a JSON object as the value for a @default tag, the first opening curly bracket is treated as part of the code.
For example:
class X {
/**
* @default { "a": 1 }
*/
foo: any;
}
Is displayed as:
VS Code version: Code - Insiders 1.91.0-insider (b36286db80c68b7fdc6bfee2f55e0208c8833dfc, 2024-06-25T09:14:46.370Z)
OS version:
Modes:
System Info: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Extensions (16)
| Extension | Author (truncated) | Version |
|---|---|---|
| anycode-c-sharp | ms- | 0.0.5 |
| anycode-typescript | ms- | 0.0.5 |
| anycode | ms- | 0.0.73 |
| anycode-php | ms- | 0.0.6 |
| anycode-python | ms- | 0.0.5 |
| anycode-rust | ms- | 0.0.6 |
| anycode-java | ms- | 0.0.5 |
| anycode-kotlin | ms- | 0.0.5 |
| anycode-go | ms- | 0.0.5 |
| anycode-cpp | ms- | 0.0.5 |
| remotehub | Git | 0.63.2024061801 |
| codespaces | Git | 1.16.23 |
| azure-repos | ms- | 0.39.2024061901 |
| remote-server | ms- | 1.6.2024061709 |
| remote-explorer | ms- | 0.5.2024061309 |
| remote-repositories | ms- | 0.41.2024022202 |
- 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