michaelgmcd / vscode-language-babel

VSCode syntax highlighting for today's JavaScript
https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel
MIT License
131 stars 17 forks source link

Syntax highlighting breaks after HTML <script> tag #71

Closed loqusion closed 2 years ago

loqusion commented 4 years ago

Describe the issue If a line of JavaScript within a script tag in HTML doesn't end in a semicolon, it sometimes breaks the syntax highlighting for the rest of the file.

Screenshot of Current Behavior image image image

Sample Code to Reproduce

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
  <script>
    require("source-map-support/source-map-support.js").install()
  </script></head>
  <body>
    <div id="app"></div>
  </body>
</html>
sevenseacat commented 3 years ago

why was this closed? I'm still seeing it as a problem :(

loqusion commented 3 years ago

Oops, I don't remember why I closed it.

michaelgmcd commented 3 years ago

Only looked into this briefly, but adding a semi-colon after install() fixes the issue. I'll continue to investigate when I can.

michaelgmcd commented 3 years ago

In short, this is a pretty difficult issue to debug. I believe it was introduced in https://github.com/michaelgmcd/vscode-language-babel/pull/56. Handling flow-type arguments has added quite a bit of complexity to function and method calls.

michaelgmcd commented 2 years ago

Try this out in 0.0.35 and let me know if this still exists.