-
Notifications
You must be signed in to change notification settings - Fork 128
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
Typescript syntax highlighting breaking on certain regex following ! #806
Comments
Confirmed with the latest grammar from master |
microsoft/TypeScript-TmLanguage#806 THIS IS DRIVING ME NUTS
Another potential solution would be to simply take the inverse of the character set in the regular expression itself, like: if (/[^():\w]/.test(reader.peek(index)))
return false; I ended up using this a few times today in some new code, but this solution is of course not always viable. Hope to see some resolution to this issue soon. |
Due to GitHub using this as their TypeScript syntax highlight grammar. |
That makes a lot of sense. |
The way I worked around this issue was to just add parenthesis around the expression:
|
Oh, I hadn't considered that under the assumption that it would throw warnings due to the |
microsoft/TypeScript-TmLanguage#806 THIS IS DRIVING ME NUTS
microsoft/TypeScript-TmLanguage#806 THIS IS DRIVING ME NUTS
@sheetalkamat When you have a chance, can you or someone on the TS team please take a look at this. We're seeing a lot of reports on the VS Code side but I had trouble figuring out what's going wrong in the grammar |
In VS Code v1.43.2, the issue and microsoft/vscode#92904 does not seem to be resolved. |
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes
Funnily enough, it appears this code breaks GitHub's syntax highlighting as well.
Escaping the parens will fix syntax highlighting on the remainder of the document, but the syntax highlighting on the regular expression itself is still broken. Removing the
!
and not escaping the parens fixes everything, but obviously that completely changes the meaning of the code.Here's the example above:
And here's the prominent example in my code that sparked this issue:
The last screenshot is from stable with all my extensions, however I can confirm it appears similarly broken on a fresh insiders install with no extensions.
The text was updated successfully, but these errors were encountered: