My Visual Studio Code's Intellisense is not working properly. Every time I try to use it with Ctrl + Shift
, it only displays a loading message. I'm using Python (with Django) and have installed ms-python.python
. I also have Djaneiro
. It is still not working.
What seems to be the problem here?
If you're coding in JavaScript or TypeScript and finds that VSCode IntelliSense does work but does not behave properly, it's likely that you've selected the wrong language mode. TypeScript and JavaScript share the same language service, so you need to select the right language.
You can trigger IntelliSense in any editor window by typing Ctrl+Space or by typing a trigger character such as the . (dot character).
For Visual Studio 2017 (and I think Visual Studio 2019 also), close Visual Studio, go into the . vs folder in your projects folder and delete all the contents apart from the . suo file, then reopen Visual Studio. This way you can rebuild the Intellisense cache without losing your preferences.
This can be caused by many reasons, some of them are as follows.
Python executable path in vscode is incorrect
settings.json
. Remember to restart vscode after.The module is located in a non-standard location
Solution: Configure settings.json
to include this location for autocompletion to work. An example (for Linux) used to add a custom module for the workspace:
{
"python.pythonPath": "/usr/bin/python",
"python.autoComplete.extraPaths": [
"${workspaceFolder}/customModule"
]
}
vscode was not launched from the active virtual environment
Installing Pylance
addon caused Vscode Intellisense to stop.
On disabling Pylance and enabling the Default Microsoft Python extension
along with Visual Studio IntelliCode(Microsoft)
and reverting to the Jedi server
(prompted by Vscode) ,restarted intellisense detection.
If you've tried everything but still if it doesn't work, in my case installing the extension Visual Studio IntelliCode with the Python extension worked.
First of all if you've installed virtualenv on your project run vscode from there. Then in your vscode settings, i mean settings.json, you can follow my configuration or trace in which one you have a problem. Most of time this problem stem from putting incorrect path in pythonPath setting
{
"python.pythonPath": "${workspaceFolder}/env/bin/python3",
"editor.formatOnSave": true,
"python.linting.pep8Enabled": true,
"python.linting.pylintPath": "pylint",
"python.linting.pylintArgs": ["--load-plugins", "pylint_django"],
"python.linting.pylintEnabled": true,
"python.linting.pep8Args": ["--ignore=E501"],
"files.exclude": {
"**/*.pyc": true
}
}
Update:
If you want to have a well-configuration of Vscode That i personally use for developing my Django and React web-applications you can glance this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With