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

PythonVisual Studio-CodeIntellisenseCode Completion

Python Problem Overview


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.

Python Solutions


Solution 1 - Python

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

Solution 2 - Python

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,

Solution 3 - Python

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.

Solution 4 - Python

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

Solution 5 - Python

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

Solution 6 - Python

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

Solution 7 - Python

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

Solution 8 - Python

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

Solution 9 - Python

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

> Visual Studio IntelliCode

Solution 10 - Python

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

Solution 11 - Python

Use Below Values in settings.json file

"editor.suggest.snippetsPreventQuickSuggestions": false,

Solution 12 - Python

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

Solution 13 - Python

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)

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAnti-DistinctlymintyView Question on Stackoverflow
Solution 1 - PythonMadMacView Answer on Stackoverflow
Solution 2 - PythonMatan DanosView Answer on Stackoverflow
Solution 3 - PythonewerybodyView Answer on Stackoverflow
Solution 4 - PythonAndrewView Answer on Stackoverflow
Solution 5 - PythonYoelView Answer on Stackoverflow
Solution 6 - PythonJulio Batista SilvaView Answer on Stackoverflow
Solution 7 - PythonMauro AntunesView Answer on Stackoverflow
Solution 8 - PythonAlisson Reinaldo SilvaView Answer on Stackoverflow
Solution 9 - PythonKhaled KherView Answer on Stackoverflow
Solution 10 - PythonSam AutreyView Answer on Stackoverflow
Solution 11 - PythonInder Pal SinghView Answer on Stackoverflow
Solution 12 - PythonJonathanView Answer on Stackoverflow
Solution 13 - PythonCat SupremeView Answer on Stackoverflow