microsoft / TypeScript-TmLanguage

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

typescript type textMate scopes highlighting error #997

Open shaddollxz opened 1 year ago

shaddollxz commented 1 year ago

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

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 : 图片 图片

shaddollxz commented 1 year ago

In function generics, if there is a line break within the generic, the issue with mismatched scopes for syntax highlighting can also occur

图片