microsoft / TypeScript-TmLanguage

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

[JavaScript] RegExp with combination of named capturing group and v flag breaks syntax coloring #1022

Closed anthonyvdotbe closed 3 months ago

anthonyvdotbe commented 3 months ago

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

Steps to Reproduce:

  1. create a file with the following contents:
    const match = /(?<n>issue)/u.exec("issue");
    // comment
    const num = 42;
  2. change the u flag to the v flag:
    const match = /(?<n>issue)/v.exec("issue");
    // comment
    const num = 42;

Expected: syntax coloring works Actual: syntax coloring breaks in step 2

anthonyvdotbe commented 3 months ago

Duplicate of #1006