microsoft / TypeScript-TmLanguage

TextMate grammar files for TypeScript for VS Code, Sublime Text, and Atom.
MIT License
397 stars 125 forks source link

Typescript syntax highlighting: Problem with JSDoc comments with JSON inside `@default` tag #1037

Open yoshigev opened 1 week ago

yoshigev commented 1 week ago

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: image

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