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

JavaScript Syntax Highlight: RegExp literals improperly parsed #15051

Closed
zrhmn opened this issue Nov 6, 2016 · 2 comments
Closed

JavaScript Syntax Highlight: RegExp literals improperly parsed #15051

zrhmn opened this issue Nov 6, 2016 · 2 comments
Assignees
Labels
grammar Syntax highlighting grammar javascript JavaScript support issues

Comments

@zrhmn
Copy link

zrhmn commented Nov 6, 2016

  • VSCode Version: 1.7.1 (02611b4)
  • OS Version: Linux Mint 17.2 (Ubuntu 14.04)

Steps to Reproduce:

  1. In a JavaScript file, type a statement containing a division operation (/) followed by a RegExp literal (/.*/) as part of the same statement e.g. var v = (a / b).toString().match(/\d*(\.\d+)?/)
  2. The code highlighter does not highlight the statement properly e.g. in the example provided in step 1, the code highlighter thinks that the / in a / b is where the RegExp literal /\d*(\.\d+)?/ starts from and highlights the whole / b).toString().match(/\d*(\.\d+)?/ part one RegExp literal.
  3. The same behaviour does not exhibit if the RegExp precedes a division operator in a similar fashion, e.g. in the statement var v = parseFloat(s.match(/\d*(\.\d+)?/).toString(), 10) / 2.5, the same RegExp literal is highlighted properly.

Example: (recreated from the "Steps to Reproduce" section)
20160111-06-16060158-9091

Another example: (this one is caught in the wild, free-range and organic)
20160911-06-16060950-4ea9

Please forgive the obscene, blasphemic JavaScript in the above example(s?). The point is, it's syntactically valid. Also, in my experience, this did not happen before the recent VSCode upgrade to 1.7.1 so I'm presuming this relates to something that was changed in 1.7.1.

@aeschli
Copy link
Contributor

aeschli commented Nov 8, 2016

This issue was moved to microsoft/TypeScript-TmLanguage#349

@aeschli aeschli closed this as completed Nov 8, 2016
@zrhmn
Copy link
Author

zrhmn commented Nov 18, 2016

Sorry. I don't quite understand.

microsoft/TypeScript-TmLanguage#349 was marked fixed, and closed. So the TypeScript-TmLanguage files are actually embedded into the VSCode resources archive? And I can only see this fix in the next update? Which is next month?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
grammar Syntax highlighting grammar javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests

3 participants