-
-
Notifications
You must be signed in to change notification settings - Fork 206
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
Intellisense for never before imported libraries doesnt work #2193
Comments
This is expected because the type definition is only loaded if there is an import to it. Loading arbitrary d.ts files from node_modules might cause some performance problems. In TypeScript projects, the auto-import also behaves like this. But in the js projects, the automatic type acquisition will also discover some of the direct dependencies in a child process. This is a feature that we didn't support, so I am marking this issue as a feature request instead of a bug. |
Do you mean in regular typescript projects that aren't svelte projects? I've never seen this in regular typescript projects or react projects. It works smoothly and I haven't seen performance issues in those projects. |
Yes. It's the same. I tried in a ts file in a plain typescript project with only a tsconfig and in a SvelteKit project. They both don't provide auto-import for newly installed packages. js projects, i.e. those without tsconfig.json or those with a jsconfig.json. Those are provided by automatic type acquisition running in another process. And we don't support that. |
Hmm. That's weird. That's different from what I saw in both Windows and Ubuntu WSL. Maybe you have some extension or config that changes the default behaviour? |
Ah. Found it. It's https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#smarter-auto-imports. From the implementation notes. |
Glad you found it! Luckily the "workaround" is fairly simple and it has little impact on our project as a whole. |
Describe the bug
When you install a Svelte library and then try to use a Svelte component in any .svelte file the intellisense cant find the library. When you add
import {} from 'library';
in any other file intellisense is able to find any component of said library.Screenshots with https://tabler.io/docs/icons/svelte as the library. Could also reproduce with https://www.skeleton.dev/.
No intellisense for any icon.
Intellisense works with
import {} from '@tabler/icons-svelte';
in same file.Intellisense works with
import {} from '@tabler/icons-svelte';
in another unused .svelte file.Reproduction
Create new sveltekit project.
Pick empty project with typescript and no other libraries.
Install https://tabler.io/docs/icons/svelte
See the screenshots in the above description.
Expected behaviour
Intellisense to work with never before imported libraries.
System Info
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: