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 breaks after multi line crocodile bracket type assertion #983

Open MrSimmmons opened 1 year ago

MrSimmmons commented 1 year ago

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

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](https://github.com/microsoft/vscode/assets/26075792/e338fced-063a-43a2-a7ce-b13ba35400bf)

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](https://github.com/microsoft/vscode/assets/26075792/b1a242b4-b091-479c-ba82-92e21a478f40)