简体   繁体   中英

VS Code IntelliSense for variables in Python

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?

If you are at least using the Microsoft language server 0.3.59.0 (beta) then you will get the expected IntelliSense: 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM