Replies: 2 comments 1 reply
-
Just activating the extension wouldn't specifically solve the issue, as it still wouldn't know what to do with the document. I believe the svelte extension, behind the scenes, mediates between For the Deno core team, something like this is not likely to be a priority for quite a long time and someone in the community would need to do the leg work, but logical changes to |
Beta Was this translation helpful? Give feedback.
-
Adding a comment here in case anyone else comes across this via searching or something... In the case of Svelte specially, it's not possible without major changes to the Svelte VS Code extension. I've been looking at the code for awhile, so I think I have this correct -- I could be wrong, but the extensive debugging I've done seems to support these ideas... It boils down to the fact the Svelte extension installs it's own copy of TypeScript as a dependency and uses that for its TS language service. It cannot use a workspace version, and it does not load any plugin configuration or settings from other extensions. I think if the Svelte extension were somehow just using the existing instance of the TS language service instead of creating a new one then the Deno extension would likely just work... Essentially the Svelte extension for VS Code takes a Svelte file, converts the syntax to TSX and then sends off that TSX code as a faux file to the TypeScript language service for type checking and then rewires the diagnostic locations and such. Meaning the Deno extension would never need to be concerned with Svelte syntax. I'm brainstorming if there is any fix I could submit to the Svelte extension. I'll simply edit this existing comment if I end up submitting anything over there. |
Beta Was this translation helpful? Give feedback.
-
It would be great if there was a way to activate the extension for JS/TS that has been embedded in another language. Take Svelte as an example, in a
foobar.svelte
file, I can write something like the following:The issue is that the embedded TS in the Svelte file doesn't activate the VSCode Deno extension and falls back to just plain TypeScript via Node.js.
I'm working on an open source starter kit for Deno built around Svelte, and it has the concept of server components which could leverage the
Deno
namespace. Also, since the extension isn't activated for Svelte files, I can't use.ts
extensions in import sources within the<script>
block.... which creates an inconsistent experience for anyone that would use the starter kit. It would be confusing to developers to use.ts
everywhere for Deno files and then forced to avoid the extension within.svelte
files.It would be great if there was a way to get this extension to play along. If you know of a way to make it work, I can take a shot at sending a PR. Ideally, it shouldn't be exclusive for just Svelte.
Beta Was this translation helpful? Give feedback.
All reactions