microsoft / TypeScript-TmLanguage

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

`as const satisfies` idiom is not highlighted correctly #956

Closed gfx closed 1 year ago

gfx commented 1 year ago

Hello, team!

I'm looking into this grammar definition and found as cont satisfies idiom is not highlighted correctly. See the example bellow.

TS and JS Grammar Extension version: 0.0.55 / latest

Code

const a = [1, 2, 3] satisfies ReadonlyArray<number>; // Array<number>
const b = [1, 2, 3] as ReadonlyArray<number>; // ReadonlyArray<number>
const c = [1, 2, 3] as const satisfies ReadonlyArray<number>; // readonly [1, 2, 3]

Screenshot:

Screenshot 2023-01-30 at 14 19 22

I'm expecting the satisfies keyword in as const satisfies to be handled in the same color as as because it's the same part of grammar.