language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

Slow Intellisense after Update to VSCode v1.77.x

Open KiddoV opened this issue 2 years ago • 18 comments

Describe the bug

Not sure what happen but the Svelte Intellisense is extremely slow after I update the VSCode:

*.svelte file example:

svelte-slow

*.ts file example

ts-not-slow

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

KiddoV avatar Apr 12 '23 15:04 KiddoV

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.

jasonlyu123 avatar Apr 12 '23 16:04 jasonlyu123

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?

KiddoV avatar Apr 12 '23 16:04 KiddoV

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.
    1. Enable "svelte.language-server.debug": true
    2. 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.

jasonlyu123 avatar Apr 13 '23 04:04 jasonlyu123

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

LFan2333 avatar Apr 13 '23 23:04 LFan2333

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.

KiddoV avatar Apr 14 '23 00:04 KiddoV

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?

jasonlyu123 avatar Apr 14 '23 01:04 jasonlyu123

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.

WoodyWoodsta avatar May 26 '23 11:05 WoodyWoodsta

Related? My language servers are just endlessly crashing

image

gl-aagostino avatar Jun 12 '23 20:06 gl-aagostino

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.

KiddoV avatar Jun 23 '23 11:06 KiddoV

Possibly related: https://github.com/tailwindlabs/tailwindcss-intellisense/issues/755#issuecomment-1594675718

WoodyWoodsta avatar Jun 23 '23 11:06 WoodyWoodsta

We won't be able to help you if we can't reproduce the problem.

jasonlyu123 avatar Jun 23 '23 11:06 jasonlyu123

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.

KiddoV avatar Jun 23 '23 12:06 KiddoV

Possibly related: tailwindlabs/tailwindcss-intellisense#755 (comment)

Tried disable Tailwind CSS IntelliSense, but still having the problem.

KiddoV avatar Jun 23 '23 12:06 KiddoV

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.

WoodyWoodsta avatar Jun 23 '23 12:06 WoodyWoodsta

VS Code 1.80.0 has just been released, and I have updated my version. However, the issue I was experiencing still persists.

KiddoV avatar Jul 07 '23 12:07 KiddoV

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

Hunnnn77 avatar Nov 24 '23 06:11 Hunnnn77

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:

  1. Set the "svelte.language-server.port": config to 9222.
  2. Restart your editor and open a svelte file.
  3. Open Chrome or Edge and type chrome://inspect. Wait a bit. There should be a svelte language server, and you can inspect
  4. After you click the inspect link, a dev tool will open. You can record a CPU profile in the performance tab

jasonlyu123 avatar Nov 28 '23 02:11 jasonlyu123

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

MiraiSubject avatar Jan 01 '24 19:01 MiraiSubject

Closing as inactive

dummdidumm avatar Jul 31 '24 12:07 dummdidumm