microsoft / TypeScript-TmLanguage

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

JavaScript Syntax Highlighter Broke #883

Open ephf opened 2 years ago

ephf commented 2 years ago

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

Steps to Reproduce:

  1. Make a JavaScript File
  2. type in: for (const req of /require *\\( *["'\](.+?)["'`] *\)/.exec(fileCode).slice(1)) {}`
  3. some things in the brakets will be highlighted incorrectly

image

hediet commented 2 years ago

This is actually a syntax highlighting issue:

// Works
const r = /te'st/.exec('test');

// Broken
for (const req of /te'st/.exec('test')) {
}

image

Bracket pair colorization makes use of the syntax highlighting tokens. Because they are broken, bracket pair colorization is broken too.

ephf commented 2 years ago

On Mon, Aug 23, 2021 at 4:45 AM Henning Dieterichs @.***> wrote:

This is actually a syntax highlighting issue:

// Worksconst r = /te'st/.exec('test'); // Brokenfor (const req of /te'st/.exec('test')) {}

[image: image] https://user-images.githubusercontent.com/2931520/130417963-e89caff5-9c91-4777-a85d-70dc62502cc2.png

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/131333#issuecomment-903565787, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASKLV2RKCDKVUR5EW2ZN4BDT6IDCHANCNFSM5CSGVWRA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Well yeah, I said that it was a Syntax Highlighter Issue.

mjbvz commented 2 years ago

Confirmed with the latest grammar version