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 error with ternary and optional types #934

Closed theusaf closed 1 year ago

theusaf commented 1 year ago

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

Minimal example:

image

VS Code version: Code 1.72.2 (d045a5eda657f4d7b676dedbfa7aab8207f8a075, 2022-10-12T22:15:18.074Z) OS version: Windows_NT x64 10.0.22000 Modes: Sandboxed: No

sheetalkamat commented 1 year ago

This is limitation of tmLangaugae where in new line cant be looked up and hence we dont know if ternary operator is continuation of variable declaration or not and is assumed to be out of variable declaration scope.