language-tools
language-tools copied to clipboard
Slow Intellisense after Update to VSCode v1.77.x
Describe the bug
Not sure what happen but the Svelte Intellisense is extremely slow after I update the VSCode:
*.svelte file example:

*.ts file example

As you can see, with svelte file it took over 5 secs for VSCode to know it is the wrong syntax, on the other hands, ts file only took ~1 sec.
Reproduction
See above!
Expected behaviour
Faster response when typing...
System Info
- OS: Windows 10
- IDE: VSCode v1.77.x
Which package is the issue about?
Svelte for VS Code extension
Additional Information, eg. Screenshots
No response
Does this happen when you disable all other extensions? You can create an empty setting profile and only install the Svelte extension.
Also, could you try if it happens in other projects? If not, we need a reproduction to be able to help you.
This still happen when I disabled all other extensions and only use Svelte ext.
I tried on a different project/repo. Looks like it is faster somehow. Hmmm 🤔 So if it only happen on this specific project/repo, any idea what causing this?
No idea. Can you try these to narrow it down more?
- If you have a custom preprocess config, try to remove it and see if it helps
- Check if the "include" and "exclude" in your tsconfig.json include any generated files.
-
- Enable "svelte.language-server.debug": true
- Go to the output channel, choose Svelte in the top-right dropdown, and see what is logged.
- Checking if you imported a large library or a large JSON file. If so, try to remove it and restart the language server.
can second this, revert back to 107.0.0 make mine work again,
The latest version simply didn't work, at all. even with CTRL+SPACE, (brings out a loading option that will stuck forever)
Weirdly, when I was on the latest version, in the first few seconds of opening VS Code intellisense was working, but it will fail very soon and then stop completely.
windows 10 Pro 1909 vs code 1.77.3
buggy version: Svelte for VS Code 107.3.0 last working version: Svelte for VS Code 107.2.5
Hope this helps
Thanks for the downgrade suggestion. Looks like it is not just me who dealing with this issue.
I noticed it is only happening on the big file - like ~1000k lines of code. When I create a new svelte file in the same repo, it responds faster on that file.
It might have something to do with TypeScript 5.0 or the fix-all quick-fix. But we still need a reproduction to know what the problem is. TypeScript 5.0 has a lot of changes. We cannot find the problem by just looking at the git diff.
I can't reproduce it with a large file. I created a 2000 lines file, and it's still pretty responsive. It might have something to do with the content of that file instead. Could you try commenting out some of the code to narrow the problem?
This is an issue for me even on VSCode 1.78.2, vscode-svelte v107.4.3. Will try to reproduce when I have time.
Related? My language servers are just endlessly crashing
Any update on this?
Downgrade to Svelte for VS Code: v107.2.5 seem to fix the issue for me, but still, we always want to use the newest version.
Possibly related: https://github.com/tailwindlabs/tailwindcss-intellisense/issues/755#issuecomment-1594675718
We won't be able to help you if we can't reproduce the problem.
We won't be able to help you if we can't reproduce the problem.
This will be hard to re-produce, as the issues only occur in random *.svelte files.
Possibly related: tailwindlabs/tailwindcss-intellisense#755 (comment)
Tried disable Tailwind CSS IntelliSense, but still having the problem.
The more important point was that there was a potential fix for the underlying cause in VScode 1.80 https://github.com/microsoft/vscode/issues/184926#issuecomment-1594190928
EDIT: I should say fix for the potential underlying cause.
VS Code 1.80.0 has just been released, and I have updated my version. However, the issue I was experiencing still persists.
even in same svelte file with less code, emmet/css/tailwind are fast, only js/ts related things for svelte (declaration something in script tag / using func,var from script, html attribute svelte specific syntax) are laggy. comparing tsx file, i think svelte lang server seems slower than not like astro extension
108.1.0 improves the performance of files with big html. Does this address the problem you all have?
If not, sorry for repeating it. Please provide a reproduction. You don't have to submit the problematic repository. You can check for things in common for files with performance problems or try removing stuff from those files to narrow down the problem.
As a last resort, you can provide a CPU profile so we can at least know where the bottleneck is. To do so, you can follow the steps:
- Set the "svelte.language-server.port": config to 9222.
- Restart your editor and open a svelte file.
- Open Chrome or Edge and type chrome://inspect. Wait a bit. There should be a svelte language server, and you can inspect
- After you click the inspect link, a dev tool will open. You can record a CPU profile in the performance tab
In my case the cause of the slow IntelliSense was the addition of "svelte-google-materialdesign-icons": "^0.8.3" this exports all of its components for the icons and makes autocomplete very slow to load. I am also using svelte-fa for fontawesome icons that we are using. I guess for now I will settle on one of these which is the more sensible choice anyway.
I have included a CPU profile of how long it takes to load with this package added: CPU-20240101T203600.cpuprofile
Here is the profiler with svelte-google-materialdesign-icons removed: CPU-20240101T204056-after.cpuprofile
Profiles were taken on 108.1.0 of the extension and the following vscode version:
❯ code-insiders --version
1.86.0-insider
9621add46007f7a1ab37d1fce9bcdcecca62aeb0
arm64
Closing as inactive