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

Slow Intellisense after Update to VSCode v1.77.x #1984

Closed
KiddoV opened this issue Apr 12, 2023 · 19 comments
Closed

Slow Intellisense after Update to VSCode v1.77.x #1984

KiddoV opened this issue Apr 12, 2023 · 19 comments
Labels
awaiting submitter bug Something isn't working

Comments

@KiddoV
Copy link

KiddoV commented Apr 12, 2023

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 KiddoV added the bug Something isn't working label Apr 12, 2023
@jasonlyu123
Copy link
Member

jasonlyu123 commented Apr 12, 2023

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.

@KiddoV
Copy link
Author

KiddoV commented Apr 12, 2023

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?

@jasonlyu123
Copy link
Member

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.

@LFan2333
Copy link

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

@KiddoV
Copy link
Author

KiddoV commented Apr 14, 2023

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.

@jasonlyu123
Copy link
Member

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?

@WoodyWoodsta
Copy link

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.

@gl-aagostino
Copy link

gl-aagostino commented Jun 12, 2023

Related? My language servers are just endlessly crashing

image

@KiddoV
Copy link
Author

KiddoV commented Jun 23, 2023

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.

@WoodyWoodsta
Copy link

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

@jasonlyu123
Copy link
Member

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

@KiddoV
Copy link
Author

KiddoV commented Jun 23, 2023

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
Copy link
Author

KiddoV commented Jun 23, 2023

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

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

@WoodyWoodsta
Copy link

WoodyWoodsta commented Jun 23, 2023

The more important point was that there was a potential fix for the underlying cause in VScode 1.80 microsoft/vscode#184926 (comment)

EDIT: I should say fix for the potential underlying cause.

@KiddoV
Copy link
Author

KiddoV commented Jul 7, 2023

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

@Hunnnn77
Copy link

Hunnnn77 commented Nov 24, 2023

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

@jasonlyu123
Copy link
Member

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

@MiraiSubject
Copy link

MiraiSubject commented Jan 1, 2024

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

@dummdidumm
Copy link
Member

Closing as inactive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants