1

I am a little bit new to python in Visual Studio Code. I was wondering how IntelliSense works for variables in python.

If I have:

var1 = "abc"

Then if I type var1.xxx I will get a lot of IntelliSense suggestions such as .split. .replace and many more.

but if i do

var1 = input()

Then this would also be considered a string, but now if I type var1.xxx I get no IntelliSense at all. In, for example, pycharm I would still get a lot of IntelliSense functions here also.

Are my VS Code settings not correct, or is this simply the way VS Code works?

3
  • 1
    Have a look at these two links code.visualstudio.com/docs/editor/intellisense code.visualstudio.com/docs/languages/python Commented Aug 18, 2019 at 9:25
  • I checked through the documentation and there seemed to be no mention about this specific topic :( Commented Aug 18, 2019 at 9:58
  • 1
    Most python versions don't have type hints (added in Python 3.7.?) so the intellisense does not know the type of the returned value of functions. If you use literals or maybe even list(), dict(),... then it knows the class Commented Aug 18, 2019 at 13:24

1 Answer 1

1

If you are at least using the Microsoft language server 0.3.59.0 (beta) then you will get the expected IntelliSense: enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

Oh thats exactly what i was looking for. For those who wonders how to implement it, Go into json settings in vscode and type "python.jediEnabled": false, and simply reload the editor. Awesome!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.