I'm used to use VS to code C++ and Eclipse to code python but lately I have tried VS for both languages.
I found something very difficult to understand that while VS autocompletes it doesn't warn you about errors before runtime.
There is no warning regarding non existent variables or methods. I can't believe that VS does not warn about this kind of typical coding issues as it does for C++ code (as every IDE does).
What am I missing?
I tested this with VS2013 and VS2015.
I'm expecting something like:
Thanks
This is because the C/C++ IntelliSense, debugging, and code browsing extension does not know about the current project. Navigate to View | Command Palette, enter and select C/C++ Build and debug active file: Select Project, and then select the correct project that you want to work with.
To display the Error List, choose View > Error List, or press Ctrl+\+E.
Do Ctrl + p, and type "settings. json" You will find the file which contains the value "C_Cpp. errorSquiggles": "Disabled" Change it into Enabled.
In VS Code, open the Settings with (Ctrl+,) then search settings for "Interpreter." There will an option for "Python: Default Interpreter Path." Set the location of your python.exe file. Open a new VS terminal with (Ctrl+Shift+`) to test the python command; you may need to restart VS Code.
In order to get the python detailed IntelliSense support in VS2015 you have to install python tools for visual studio which provide the following:
And the best thing, it's completely free.
Just download it from here:
https://www.visualstudio.com/en-us/features/python-vs.aspx
I hope it supports your question.
Update after comment:
You just need to refresh the Database. It works for me. Check to make sure the environment options are set (specifically path variable to PYTHONPATH) and the DB is refreshed.
Sometimes Deleting the __init__.py
file in my source root directory did the trick
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