Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS syntax highlighter confuses apostrophe in Regexp literal #91537

Closed
danielrentz opened this issue Feb 26, 2020 · 1 comment
Closed

TS syntax highlighter confuses apostrophe in Regexp literal #91537

danielrentz opened this issue Feb 26, 2020 · 1 comment
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) grammar Syntax highlighting grammar javascript JavaScript support issues typescript Typescript support issues

Comments

@danielrentz
Copy link

danielrentz commented Feb 26, 2020

  • VSCode Version: 1.42.1
  • OS Version: Windows 10

Steps to Reproduce:

  1. Create a TS file
  2. Type:
    export const c1 = "abc";
    if (!/^['"]$/.test(c1)) { }
    export const c2 = 2;

The code after the apostrophe in the RE will be rendered as string. The keywords "export const" in the third line will not be highlighted anymore.

Removing the exclamation mark before the RE lets the bug disappear, as well as enclosing the RE into parentheses.

@mjbvz
Copy link
Collaborator

mjbvz commented Feb 26, 2020

Duplicate of microsoft/TypeScript-TmLanguage#806

@mjbvz mjbvz closed this as completed Feb 26, 2020
@mjbvz mjbvz added *duplicate Issue identified as a duplicate of another issue(s) grammar Syntax highlighting grammar javascript JavaScript support issues typescript Typescript support issues labels Feb 26, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s) grammar Syntax highlighting grammar javascript JavaScript support issues typescript Typescript support issues
Projects
None yet
Development

No branches or pull requests

2 participants