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

Syntax coloring partially missing for JavaScript blocks inside HTML file #205942

Closed
UweKeim opened this issue Feb 22, 2024 · 2 comments
Closed

Syntax coloring partially missing for JavaScript blocks inside HTML file #205942

UweKeim opened this issue Feb 22, 2024 · 2 comments
Assignees

Comments

@UweKeim
Copy link

UweKeim commented Feb 22, 2024

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

(I've even removed all user settings from "C:\Users\ukeim\AppData\Roaming\Code\User\settings.json" and restarted VS Code with no improvement)

  • VS Code Version: 1.86.2 (user setup)
  • OS Version: Windows_NT x64 10.0.22631

Steps to Reproduce:

  1. Open this attached HTML file into VS Code.
  2. See that syntax coloring is not applied to all JavaScript code inside the <script> block.

Please note that for a short amount of time (approx. half a second) right after opening the file in VS Code, the syntax coloring is correct and then flashes (and stays) immediately to wrong.

Example screenshots of incomplete syntax coloring:

image

image

(I've underlined some, but not all, items missing color)

@mjbvz mjbvz assigned aeschli and unassigned mjbvz Feb 27, 2024
@UweKeim
Copy link
Author

UweKeim commented Feb 27, 2024

OMG, I figured out the reason.

My attached HTML file has this in line 152:

<script>var $z = $.noConflict(true); var showFrameTimeout</script>

When removing this line, the whole HTML syntax-coloring is correct, again.

After digging further, I found out that the missing semicolon (;) right after showFrameTimeout is the cause of the whole mess.

To fix this, I rewrote the line 152 this way:

<script>var $z = $.noConflict(true); var showFrameTimeout;</script>

After that, everything looks correctly colored.

This was the most important semicolon in my whole developer's life of over 25 years 🥰.

Still, I would love if VS Code would not stumble (and fall) over one missing semicolon.

@aeschli
Copy link
Contributor

aeschli commented Feb 28, 2024

Yes, this is an annoying issue but unfortunately not easy to fix

Duplicate of #70614

@aeschli aeschli closed this as completed Feb 28, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants