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

Svelte support #171

Closed
mlbiche opened this issue May 25, 2020 · 6 comments · Fixed by #215
Closed

Svelte support #171

mlbiche opened this issue May 25, 2020 · 6 comments · Fixed by #215

Comments

@mlbiche
Copy link

mlbiche commented May 25, 2020

I have edited the plugin configuration to support .svelte files :

"importCost.javascriptExtensions": [ "\\.jsx?$", "\\.svelte$" ],
"importCost.typescriptExtensions": [ "\\.tsx?$", "\\.svelte$" ]

Several issues show up from the plugin debug console :

  • importCost error: SyntaxError: Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>? (6:0)
  • importCost error: SyntaxError: Unexpected token, expected "}" (16:4)
  • importCost error: SyntaxError: Unexpected token (98:1)

Tested on these two files :

Note that it is failing parsing rollup.config.js file which is pure JS :

Setting Decoration: , {
  "fileName": "[...]/rollup.config.js",
  "name": "@rollup/plugin-commonjs",
  "line": 1,
  "string": "import commonjs from '@rollup/plugin-commonjs';\nconsole.log(commonjs);",
  "size": 0,
  "gzip": 0,
  "error": {
    "err": [
      "unknown: Unexpected token (863:33)",
      "bundle.js from Terser\nOctal escape sequences are not allowed in template strings [bundle.js:8476,25]"
    ]
  }
}

And calculating size of 0 for all other Rollup modules.

@simonwiles
Copy link

I'm not seeing errors in the plugin debug console (I do have "Enable debug logging" turned on), but I'm not seeing import cost annotations either (I do have "importCost.javascriptExtensions": ["\\.jsx?$", "\\.svelte$"], configured).

@mlbiche
Copy link
Author

mlbiche commented Dec 14, 2020

It's been a while I haven't worked on my Svelte project. I have just opened it again tonight and indeed, it seems that I no longer have any errors in the plugin debug console and I am not seeing import cost annotations

@yairhaimo
Copy link
Contributor

I published a new version of the extension (2.14.0) that should support Svelte.
I am not a Svelte developer so I might have missed something. Please play with it and let me know.

@mcmxcdev
Copy link

Works great for me, thank you for the effort!

@mlbiche
Copy link
Author

mlbiche commented Jan 26, 2021

Glad to see that some work was finally needed and that you could manage 👍
BUT 🙊 ... I am using VSCodium and the update seems not to be available yet (neither the 2.13.0 🤔 ). Am I too impatient ? Or is it on purpose ? It seems that it has to be published on Open VSX Registry but it might already be as I have the 2.12.0 version of the extension installed on VSCodium.
Do you want me to create a specific issue ?

Cheers 🤙

@yairhaimo
Copy link
Contributor

There is issue #198 which I will look into tomorrow or the day after so no need to create a new issue.
I'll ping you when I do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants