178

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.

Anti-Distinctlyminty
  • 2,615
  • 5
  • 22
  • 24
  • 12
    Any solution to this problem? I facing the same. VsCode v1.33 and happens with all extensions disabled as well. – cbdeveloper Apr 09 '19 at 10:32
  • 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. – ZeferiniX Apr 10 '19 at 18:16
  • 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% – Anti-Distinctlyminty Apr 16 '19 at 12:17
  • 1
    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. – MadMac May 14 '19 at 23:51
  • 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. – Andy Jul 22 '20 at 18:31
  • @Anti-Distinctlyminty, were you able to solve this issue? – dhiraj suvarna Sep 08 '20 at 11:07
  • @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. – Anti-Distinctlyminty Sep 08 '20 at 15:08
  • @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. – dhiraj suvarna Sep 08 '20 at 16:53
  • 1
    @dhirajsuvarna If you can reproduce the issue, then report a bug over at https://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. – Anti-Distinctlyminty Sep 09 '20 at 08:16
  • I notice this in particular when including the Pandas module. – D.L Apr 08 '21 at 10:05
  • This Might help--> https://stackoverflow.com/a/69834732 – Inder Pal Singh Nov 04 '21 at 05:09

21 Answers21

82

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
MadMac
  • 4,048
  • 6
  • 32
  • 69
  • 1
    This is a great solution, at least you know the culprit this way! It resolved the issue. – Sagar Khatri Feb 01 '21 at 11:51
  • 1
    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) :) – Naren Mar 06 '22 at 16:14
  • 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. Thanks – mtirtapradja Mar 15 '22 at 02:39
  • I closed and opened the VSCode after these operations and worked for me. – Darwin Sep 25 '22 at 10:55
  • 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. – bradykey Feb 02 '23 at 20:23
  • Todo Tree by Gruntfuggly extension was my culprit. No issue with the Angular Language Service on my end. – Reza Taba Apr 23 '23 at 19:07
  • 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... – IceFire May 10 '23 at 06:25
52

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,
Ilyas karim
  • 4,592
  • 4
  • 33
  • 47
Matan Danos
  • 796
  • 1
  • 10
  • 14
42

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.

ewerybody
  • 1,443
  • 16
  • 29
26

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).

Andrew
  • 5,839
  • 1
  • 51
  • 72
  • 8
    I also found the "C_Cpp.intelliSenseCacheSize": 0,setting useful – Kevin Oct 28 '19 at 22:42
  • @kevinf Good find! It doesn't show up in the Settings... https://code.visualstudio.com/docs/cpp/faq-cpp#_ccppintellisensecachesize-number – Andrew Oct 29 '19 at 21:33
  • 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. – Evgen Sep 09 '21 at 01:57
26

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...

jizhihaoSAMA
  • 12,336
  • 9
  • 27
  • 49
Yoel
  • 7,555
  • 6
  • 27
  • 59
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

Julio Batista Silva
  • 1,861
  • 19
  • 19
7

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

mukesh.kumar
  • 1,100
  • 16
  • 30
Mauro Antunes
  • 71
  • 1
  • 2
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

Alisson Reinaldo Silva
  • 10,009
  • 5
  • 65
  • 83
  • 2
    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. – Simon_Weaver Mar 05 '21 at 01:47
5

Use Below Values in settings.json file

"editor.suggest.snippetsPreventQuickSuggestions": false,
Inder Pal Singh
  • 380
  • 4
  • 16
4

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

Visual Studio IntelliCode

2

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

Sam Autrey
  • 121
  • 1
  • 4
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.

Ryan
  • 21
  • 1
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

Jonathan
  • 126
  • 6
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)

shreyasm-dev
  • 2,711
  • 5
  • 16
  • 34
0

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

Darwin
  • 1,695
  • 1
  • 19
  • 29
0

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

  • 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](/help/how-to-answer). – Community Oct 10 '22 at 02:35
0

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

Harty911
  • 69
  • 6
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.

0

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

xEc
  • 359
  • 2
  • 12
0

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

Reza Taba
  • 1,151
  • 11
  • 15
0

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

Youssef Maouche
  • 175
  • 1
  • 2
  • 10