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

export let in plain js script tags breaks syntax highlighting #320

Closed
canadaduane opened this issue Jul 18, 2020 · 5 comments
Closed

export let in plain js script tags breaks syntax highlighting #320

canadaduane opened this issue Jul 18, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@canadaduane
Copy link

Describe the bug
When adding an export let in plain javascript <script> tag, it breaks the rest of the syntax highlighting:

To Reproduce
Sample:

<script>
  import RightPanel from './RightPanel.svelte'

  export let start
</script>

<!-- a 'comment with dangling apostrophe -->
<RightPanel />
<PressTabHelp />

Expected behavior
The closing </script> tag should be recognized as the end of the javascript section.

Screenshots
image

System (please complete the following information):

  • OS: Mac OS 10.14.6
  • IDE: VSCode
  • Plugin/Package: "Svelte for VSCode" 101.3.0
@canadaduane canadaduane added the bug Something isn't working label Jul 18, 2020
@jasonlyu123
Copy link
Member

Sorry. I can't reproduce this. Maybe this is an upstream issue, the syntax highlight within script tag was defined to be like "hey IDE, handle js for me". What is your VSCode version?

@canadaduane
Copy link
Author

Hmm, interesting. I wonder what else I could look for. Here is my VS Code version info:

Version: 1.47.0
Commit: d5e9aa0227e057a60c82568bf31c04730dc15dcd
Date: 2020-07-09T08:01:54.115Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 18.7.0

@canadaduane
Copy link
Author

Possible hint: when I use lang="ts" it parses correctly.

Is there a way I can discover what parser/ecmascript version Svelte is handing it off to?

@jasonlyu123
Copy link
Member

jasonlyu123 commented Jul 19, 2020

Can you try to disable any extension except svelte for vscode and see if it persist? Or try the same code in js file?
It might also be any other extension that alters the syntax highlight.

@canadaduane
Copy link
Author

canadaduane commented Jul 19, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants