Visual Studio Code Intellisense is very slow - Is there anything I can do?
Asked Answered
M

23

188

Edit: Pylance seems to be much better at this and has so far resolved all problems with the previous Python language server from Microsoft.

I'm using VS Code and it's wonderful is all areas but code completion, where it is usually just too slow to be of any use. This example shows how long intellisense took to to find a local variable, and this is only after it was prompted to do so after I hit ctrl+enter.

enter image description here

I've not been able to find a solution to this as of yet, so I am here to ask if anyone else has had a similar issue and ask how they have overcome it.

Matz answered 16/8, 2018 at 10:6 Comment(11)
Any solution to this problem? I facing the same. VsCode v1.33 and happens with all extensions disabled as well.Connive
Same issue. With v1.33, it got really worse on my end. I'm using Windows 10 Pro 64bit on a 250GB SSD, 16GB RAM and i5-4460 CPU. I don't think it's a hardware issue as it seems plenty imo. Tried complete fresh install after deleting the appropriate files at %userprofile% and %appdata%, same issue. Disabling all extensions doesn't help either. If enabled, all extensions' jobs are delayed way longer than what's shown in the screenshot.Ednaedny
I had better luck with the new Microsoft Python Language Server. This may be a stupid thing to suggest, but make sure you're using that. And try a completely fresh project as some settings may be defined in the workspace file, not the %userprofile%Matz
I have this issue too. It takes 7s to pop up. I have a brand new laptop and it is worse than on my old laptop which is really old and slow.Inspiration
Having implemented some extensions that provide completions myself, I think the architecture for gathering completions is seriously flawed, and will have to be redesigned someday to reduce redundant and excess computation. For starters it seems like it doesn't show results as they come in but rather waits until it's gotten all possible results to show them.Lands
@Anti-Distinctlyminty, were you able to solve this issue?Exemplify
@dhirajsuvarna I think the intellisense engine has been rewritten since I originally posted this. The new one does seem better, but I do still get cases where autocomplete doesn't work at all, but that may be due to my setup and certain packages not being scanned.Matz
@Anti-Distinctlyminty, thanks for the comment, I have only python extension installed on my visual code, and intellisense is not good at all. I was wondering if I there is something I am missing.Exemplify
@dhirajsuvarna If you can reproduce the issue, then report a bug over at github.com/microsoft/vscode-python/issues (or see if the issue is already reported there). It takes a little effort, but it's the only way to get stuff fixed.Matz
I notice this in particular when including the Pandas module.Gley
This Might help--> stackoverflow.com/a/69834732Trip
A
44

Maybe it's Jedi. I mean its awesome but ... Tinkering with Jedi myself on bigger code bases I can confirm that it might be uber slow at times and pretty hard to figure out what the problems are... :/

Solution might be to switch to another language server! The VSCode Python extension has a "Language Server"-setting:

enter image description here

aka python.languageServer.

Pylance is MS own new language server. I just tried it and it all seems a little snappier. As of today this is tagged as Preview. So there might be improvements around the corner.

Accusal answered 17/8, 2020 at 17:12 Comment(5)
This solved it for me! The lag was too annoying, Pylance seems to work much better and provides better error checking in some cases.Crotchet
Same for me, Pylance seems to be a ton better than Jedi.Archducal
To be fair, Jedi is 8 years old and multi-purpose! Yeah, maybe it was time for something new ;)Accusal
Any suggestions for the Java Intellisense?Anaesthesiology
I can also confirm that Pylance works way faster than Jedi. Does anyone know what could be the reason for this?Ninnette
I
95

It turned out it was a particular VS Code extension for me.
Angular Language Service. Disabling this made it lightning quick.

Try this to see if it is a particular extension.

  • Open Command Palette (Ctrl+Shift+P)
  • Type in "Disable all installed extensions"
  • Enable them one by one or in groups and test the intellisense speed
Inspiration answered 15/5, 2019 at 0:48 Comment(8)
This is a great solution, at least you know the culprit this way! It resolved the issue.Truncheon
Actually this should be the accepted answer. because over the course of few years you'll end up with 100s of extensions (that you never knew you had installed) :)Fairground
I think this solution suit best for my use case, especially combine with solution below this answer by changing the delay to 5ms it makes the intellisense feel snappier. ThanksCommission
I closed and opened the VSCode after these operations and worked for me.Harmonica
Another easy "solution" is to run the Developer: Reload Window action from the command palette. i.e. Cmd/Ctrl + Shift + P > "reload" > "Developer: Reload Window". This is much faster than closing and re-opening VSCode.Maestas
Todo Tree by Gruntfuggly extension was my culprit. No issue with the Angular Language Service on my end.Rations
Is there any way to FIND the extension? I'm having tons of extension, so going through all one by one is not really that helpful...Nolasco
I disabled all my extensions, but VSCode is still very laggy. I'm wondering if it's related to syntax highlighting, and if there are some constructs I should avoid in my code to help make it faster...Upstairs
S
55

The problem might be with wrong setting configuration.
You might want to make sure these setting are on:

Controls if suggestions should automatically show up while typing

"editor.quickSuggestions": {
  "other": true,
  "comments": false,
  "strings": false
},

Controls the delay in ms after which quick suggestions will show up

"editor.quickSuggestionsDelay": 10,
Schreibe answered 16/8, 2018 at 10:39 Comment(2)
It worked for me, but sometimes it's inconsistentProfessionalism
Tried and does not working well Java with VSCodeAnaesthesiology
A
44

Maybe it's Jedi. I mean its awesome but ... Tinkering with Jedi myself on bigger code bases I can confirm that it might be uber slow at times and pretty hard to figure out what the problems are... :/

Solution might be to switch to another language server! The VSCode Python extension has a "Language Server"-setting:

enter image description here

aka python.languageServer.

Pylance is MS own new language server. I just tried it and it all seems a little snappier. As of today this is tagged as Preview. So there might be improvements around the corner.

Accusal answered 17/8, 2020 at 17:12 Comment(5)
This solved it for me! The lag was too annoying, Pylance seems to work much better and provides better error checking in some cases.Crotchet
Same for me, Pylance seems to be a ton better than Jedi.Archducal
To be fair, Jedi is 8 years old and multi-purpose! Yeah, maybe it was time for something new ;)Accusal
Any suggestions for the Java Intellisense?Anaesthesiology
I can also confirm that Pylance works way faster than Jedi. Does anyone know what could be the reason for this?Ninnette
P
29

My answer's for c++ but still kinda related.

I'm using the C/C++ extension from Microsoft, and when I switched its Intelli Sense Engine setting from Default, with "context-aware results", to Tag Parser, with "'fuzzy' results that are not context-aware", it immediately started showing IntelliSense options instead of delaying for 5+ seconds.

So maybe check the particular options of your language's or environment's extension(s).

Poinsettia answered 8/9, 2019 at 1:10 Comment(3)
I also found the "C_Cpp.intelliSenseCacheSize": 0,setting usefulElaterin
@kevinf Good find! It doesn't show up in the Settings... code.visualstudio.com/docs/cpp/…Poinsettia
In my case, it takes about a minute to look up any symbol. And it's not any faster the second time around. It's a non-remote Linux configuration, and the codebase is relatively small. I think it's re-parsing everything every time, and it's unclear why.Larval
C
28

Open Command Palette (Ctrl+Shift+P)

Command Palette

Select Developer: show running extension

You will get their list of extensions and their reboot time list

If extension takes more than 500ms to activate there seems to be a problem with it

You can press on right click and stop it

right click

more details...

Changeable answered 14/6, 2020 at 6:46 Comment(0)
W
8

I had the same problem with Python on VS Code. In my case, disabling Jedi for IntelliSence made things faster.

Just set "python.jediEnabled": false in the options.

As memory is not a problem for me, I also enabled code analysis to keep parser trees in memory: "python.analysis.memory.keepLibraryAst": true

Womble answered 24/4, 2020 at 14:35 Comment(2)
Seems "python.jediEnabled" is no longer an available optionImpugn
"python.analysis.memory.keepLibraryAst" is also apparently also not an option anymore :(Integer
S
8

I had the same problem. Disabling the checkbox for the "Snippets Prevent Quick Suggestions" option in VSCode settings seems to solve the problem of the loading time.

Disable Quick Preview

Salem answered 1/3, 2021 at 21:13 Comment(0)
C
6

If you're working with Angular and noticed intellisense slowness in the past days, it could be Angular Language Service with its new Experimental-ivy feature.

You can disable it by opening the extension settings:

Manage Extensions UI

Then disable the Experimental-ivy feature:

Disable ivy


VS Code prompted me to enable it at some point, I enabled and since then intellisense is super slow. By disabling this with the steps above, now it's fast again.

Prompt Dialog

Cham answered 23/2, 2021 at 4:23 Comment(1)
It's an absolute nightmare right now. Looks like this is helping a lot. I can see that it's clearly doing a lot of work, but I just don't understand how something like F12 can become so slow. All it has to do is look in the imports and go to the file specified there but it can take ten seconds for me! I've literally been having to search for class X instead of just hitting F12.Menam
M
5

my issue was solved by disabling this extension that was not installed completely

Visual Studio IntelliCode

Madelle answered 4/5, 2021 at 12:49 Comment(0)
T
5

Use Below Values in settings.json file

"editor.suggest.snippetsPreventQuickSuggestions": false,
Trip answered 4/11, 2021 at 5:8 Comment(0)
B
3

Strange solution for me, but disabling then re-enabling all extensions fixed the issue for me.

Bony answered 27/7, 2021 at 14:29 Comment(0)
O
2

I recently stumbled upon the same issue after factory resetting my computer. My issue was there was a misalignment by workplace Typescript version and the selected typscript of VSCode.

For others using TS.

On the bottom on the blue line, left for "Typescript" there is a Button "{}", it will appear a "Select Version" option, when click on hovering on this button.

Overstay answered 4/4, 2023 at 15:57 Comment(0)
R
2

The issue for me was Todo Tree by Gruntfuggly Extension. I also have Angular Language Service but works fine.

Rations answered 23/4, 2023 at 19:5 Comment(0)
T
1

For me, I had installed the Arduino extension.
This was problematic as it thought it should be in use every time I was coding in C++ so it was really slowing down the autocompletes.

I just disabled it for my workspace and everything work really quickly

Torch answered 11/10, 2020 at 9:19 Comment(0)
H
1

I had the same issue, I downgraded pylance to v2022.10.20 this fixed it for me.

Highflier answered 24/4, 2023 at 23:52 Comment(0)
M
0

None of these solutions worked for me. What worked for me, is that I went to the extension settings and:

  • changed IntelliSense mode to windows-gcc-arm64 (I was selecting different options for this one based on my os, till I found the fastest one)

  • changed IntelliSense update delay from 2000 to 500 (this added a bigger boost, after the first boost from a change in IntelliSense mode)

Martinmas answered 9/10, 2021 at 17:38 Comment(0)
H
0

I used git without .gitignore . Add .gitignore and add unnecessary files and directories like virtualenv in that.

Harmonica answered 9/9, 2022 at 4:58 Comment(0)
A
0

Click the Windows key and R at the same time, then type %temp%, then find .vscode file. Delete it. Happy coding.

Amitosis answered 6/10, 2022 at 19:26 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Beaudette
B
0

I had the same issue, I disabled extensions one by one. Disabling "Live Server (v5.7.9)" extension fixed it for me.

Baudoin answered 8/11, 2022 at 8:28 Comment(0)
B
0

You could check as previously suggested, to disable some extensions and retry using the reference finder function.

For my case, the Makefile Tools extension (https://marketplace.visualstudio.com/items?itemName=ms-vscode.makefile-tools), minutes after overtaking C/C++ IntelliSense, it just plainly broke over and over.

Bugleweed answered 11/11, 2022 at 17:15 Comment(0)
S
0

For me it was the "Multiple clipboards for VSCode" extension, disabling it fixed my issues.

Stepsister answered 25/11, 2022 at 13:27 Comment(0)
E
0

I have nearly same issue when i use another keyboard setting, which is not English (VNI for Vietnamese), when i change back to English keyboard setting (ABC) it now works OK for me.

Equip answered 24/9, 2023 at 15:11 Comment(1)
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.Beaudette
M
0

I had the same symptoms Upgrading the vscode fixed the problem.

Download link : https://code.visualstudio.com/download

enter image description here

Help -> Info -> Version

Check it out!!

Check New Version link : https://code.visualstudio.com/updates

Mendenhall answered 12/10, 2023 at 10:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.