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

Does not work in VSCode and a common SvelteKit project. #259

Open
enyo opened this issue Feb 24, 2024 · 2 comments
Open

Does not work in VSCode and a common SvelteKit project. #259

enyo opened this issue Feb 24, 2024 · 2 comments

Comments

@enyo
Copy link

enyo commented Feb 24, 2024

I assume that this is related to #212 but I wasn't able to get it to work in normal .ts files either so I'm creating a new issue.

Here is the reproduction: https://github.com/enyo/typescript-css-modules-demo

There are only 2 commits:

  1. The first commit after doing npm create svelte@latest my-app
  2. My changes that add typescript-plugin-css-modules and show that there is no intellisense.
@enyo enyo changed the title Does not workin VSCode and a common SvelteKit project. Does not work in VSCode and a common SvelteKit project. Feb 24, 2024
@enyo
Copy link
Author

enyo commented Feb 24, 2024

I'm pretty sure that this is due to sveltejs/language-tools#905

So I guess that this plugin can't do anything about it.

Maybe it's worth adding a note with a link to the issue to the README so svelte users don't need to bang their head against the table?

@jasonlyu123
Copy link

jasonlyu123 commented Feb 25, 2024

It should work in ts/js files. You probably missed this section in the README https://github.com/mrmckeb/typescript-plugin-css-modules?tab=readme-ov-file#visual-studio-code. That's the first problem I encounter when opening your reproduction.

And for svelte files, it's explained in the issue you linked. The object needed for the language service plugin simply doesn't exist in the Svelte language server. I'll reply to the comment you asked in that issue. It also won't work in the +page.ts + +layout.ts files in a SvelteKit project because of the way zero-config type-safety was implemented in the typescript-svelte-plugin(not to be confused with the vscode extension or the svelte language server). So this is not something that can be fixed in typescript-plugin-css-modules.

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

No branches or pull requests

2 participants