-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
LSP is slow #2543
Comments
Can you provide a reproduction repository where you see the slowness? Else there's not much we can investigate here. |
Okay, I'll update you |
It is indeed slow for me as well. I literally turned it off because I have to wait for autocompletion for like 3 seconds or so and the project is not even complex. Also I am not down on any system resources and it's pretty modern setup. |
If you have a reproduction that would be great. Is this a Svelte 5 project? |
Svelte 5, yes. I'm not even sure about reproduction, it works the same on any Svelte 5 project. Compared to typescript and go, lsp is incredibly unresponsive |
Please provide a reproduction repository (it's fine if it's just your whole open source repository, if it is one) with steps how to reproduce the slowness |
Thank you for supporting us! I've probably managed to reproduce the problem, so I'll send you a minimal repository and a reproduction video. Please check it out! https://github.com/noughts/svelte-ls-demo 2025-01-31.19.21.21.mov |
@noughts This problem is probably similar to #2244. The libary has a huge package.json with nearly 1000 entries in its export map. But I can't reproduce the performance issue with the last version. Both the caching and parser error issues I mentioned in that issue should be resolved now. You mentioned it'll get faster after the first completion. So at least you should be using a version with the auto-import cache. Can you check if you have the latest version of the extension and if you're using Svelte 5.16+? |
@jasonlyu123 Thank you for your support! It certainly looks like this issue is similar to #2244. I made sure I installed and tested the latest versions of Svelte / SvelteKit / Svelte For VS Code Extension all installed. Svelte: https://github.com/noughts/svelte-ls-demo/blob/main/package-lock.json#L1327 |
Either way, I'm glad to know that the problem is caused by libraries with large amounts of I can avoid the degradation of the developer experience by avoiding such libraries. Thank you for your support! |
You also don't have the svelte.language-server.ls-path config right? If so, you can check if the custom language server installation is the latest version. Now since there is auto-import cache and the parser error problem is resolved. The performance issue with a large export map in package.json is mostly a TypeScript issue. You could try if the problem also exists in a ts file in your environment. If this is the case, you can consider opening an issue in TypeScript. I didn't do it when we were checking out #2244 because I didn't understand why is it necessary, and the problematic libary was mostly a svelte-specific icon libary but date-fns isn't the case. Edit: oops I accidentally clicked the wrong button 😆 |
I have the same problem too, it's very slow. svelte_vscode_extension.mp4my Package.json: |
@itskazemk I can't reproduce the issue with just the package.json. Are you using the latest version of the extension and are you using Svelte 5.16+? Also, the delay should only appear the first time you try to auto-import in a file. If this wasn't the case, please provide a reproduction repository. SvelteKit uses ESM module system so the module resolution config in the jsconfig/tsconfig is set to module resolution The problem should also exist in a TypeScript file. In older svelte versions, There is the parser-error state issue that might cause TypeScript to load more auto-import so it has a longer delay. But it should happen less frequently with Svelte 5.16+. |
Is it me or this LSP is kinda slow? I'm used to instant response from Gopls and at least for small projects, the language as complex as Haskell, has quite fast response times. But Svelte seems to require you to wait for few seconds before seeing errors, etc. What can we do to make it faster if possible at all?
The text was updated successfully, but these errors were encountered: