IntelliSense can also be extended to support other lesser known programming languages by installing a language extension. In VSCode, IntelliSense should be working right out of the box, but after some times, it may stopped working due to unknown reasons. In this article, we will show you a few possible fixes you can apply if IntelliSense is not working.
Language server is not running
IntelliSense depends on a language service process running in the background to provide intelligent code editing features. If you find that IntelliSense has stopped working all of a sudden, there’s a chance that the language service has been terminated for some reasons. In this case, a VSCode restart or PC reset is enough to solve the issue.
Add C# project information file
If you’re working with C# code, you should be aware that IntelliSense, along with advanced editing features, can only be enabled if there’s a project.json file or *.sln file inside the project directory.
By default, any time you open a folder/directory, VSCode will scan its contents for project.json and *.sln files and if they’re found, load them all.
In case you have a project.json, you have to open a DNX-project and VSCode will load that project plus the referenced projects.
*.sln-file is opening a MSBuild-project. It will load the referenced
*.csproj-projects and sibling or descendant
project.json-files but no other project files that are referenced from the solution file.
Install C# extension
If you’re starting a new C# project and find out that IntelliSense doesn’t work, maybe you haven’t install the C# extension for VSCode. There will be a notification pops up asking you to do that.
After install the extension, press Ctrl + Shift + P to bring up the Command Palette, then type in OmniSharp: Select Project and choose the workspace appropriately. You may also need to enable C# formatting in VSCode settings.
Python : Reinstall Python/Pylance extension
Previously, using VSCode with Python, especially in conjunction with virtual environments needs heavy configuration effort. However, since Pylance became the default language server for Python in VSCode, things get easier and closer to "just work". Sometimes it doesn’t, though, then you simply need to uninstall and reinstall Python/Pylance to bring IntelliSense back.
We hope that the information above is useful to you. If you’re interested in advanced editing features of VSCode, check out our post on how to enable/disable word wrap in VSCode, How to use LaTeX in VSCode or how to automatically indent your code in Visual Studio Code.
If you have any suggestions, feel free to comment below and we will add it to the article.