-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
[html] embedded java script grammar doesn't end because of missing semicolon #70614
Comments
If your cursor is inside the JS script tag then |
the cursor is outside the script tag, html elements being commented by "//" because I forgot a ";" in the single line script tag |
Can you include a code sample or screenshot or something, I can't reproduce this |
Ah I see it in that case. I think it will parse the opening |
We use the grammar to detect embedded ranges, and the HTML grammar embeds the JavaScript grammar which isn't aware that it's embedded. A fix for textmate/html.tmbundle#85 would fix that Alternative would be to not use text mate to detect embedded ranges. Related issue: |
I think that textmate/html.tmbundle#85 will actually be fixed by microsoft/vscode-textmate#85, which I think was released this morning to 4.1.1 of the VS Code TextMate engine. Hopefully we'll see this in insiders tonight and can check it out. |
I don't think this issue will be fixed by microsoft/vscode-textmate#85, as I look at this, this specific issue is a limitation of TextMate, which lacks a construct that acts something between the Begin/End rules and the Begin/While rules. Begin/While rules solve a very specific problem, but cannot be used here. We really could use a Begin\Until system. Unlike a Begin\While rule, a Begin\Until rule would capture all the content of the line up to the point the Until pattern matched and process it with the current rule stack, before restoring the stack to the condition it was in before the Begin/Until rule began. |
Steps to Reproduce:
1.forget a semi-colon in a script tag in head (not required in JS for every line)
2.press ctrl + /
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: