microsoft/TypeScript-TmLanguage

Typescript syntax highlighting breaks after multi line crocodile bracket type assertion

MrSimmmons opened this issue · 0 comments

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

  • VS Code Version: Version: 1.78.2 (Universal)
  • OS Version: macOS 13.4

Steps to Reproduce:

  1. past the following code into a file which has TypeScript set as the language
const req: { query: Record<string, unknown> } = { query: {id1: 'foo', id: 'bar'} };

const { id1, id2 } = <
  {
    id1: string;
    id2: string;
  }
>req.query;

if (id1) {
  throw new Error('syntax highlighting broke');
}

const backToNormal = 'yay';

if (id2) {
  throw new Error('syntax highlighting is back');
}

Screenshot was taken on an instance with all extensions disabled.
Notice how the highlighting breaks after the req.query for the following if statement and its contents.
Screenshot 2023-06-07 at 5 14 54 PM

Here is a second screenshot with different theme added. You can see it breaks in the same spot.
Screenshot 2023-06-07 at 5 15 38 PM