简体   繁体   English

VSCode 是否支持用于 IntelliSense 的 Python .pyi 文件?

[英]Does VSCode support Python .pyi files for IntelliSense?

In VS Code, I tried importing a module called foo.py that has a type hinting stub file foo.pyi .在 VS Code 中,我尝试导入一个名为foo.py的模块,该模块具有类型提示存根文件foo.pyi I want to get code autocompletion based on the type hints in the .pyi file, as PyCharm does .我想根据.pyi文件中的类型提示获取代码自动完成功能,就像PyCharm 一样 However, the .pyi file does not seem to have any effect.但是,.pyi 文件似乎没有任何效果。 Does anyone know if this feature is supported?有谁知道是否支持此功能?

如果您使用Pylance 语言服务器,它将设置"python.languageServer": "Pylance"作为安装它的副作用,应该支持它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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