microsoft / TypeScript-TmLanguage

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

TypeScript Named Tuples cause the coloring to get messed up #901

Closed Zamiell closed 1 year ago

Zamiell commented 2 years ago

TS and JS Grammar Extension version: 1.4.0

Code

const v = {
  room: {
    /** Indexed by grid index. */
    initializedGridEntities: new Map<
      int,
      [gridEntityType: GridEntityType, state: int]
    >(),
  },
};

It looks like this in VSCode:

image

Notice how the final characters should be white, but they are instead blue because the named tuple messes the rest of the block up.

sheetalkamat commented 1 year ago

This is limitation of tmGrammr Map< is treated as relational operator instead of type argument start because we cant lookup beyond the line. Duplicate of #738