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

Does VSCode support Python .pyi files for IntelliSense?

在 VS Code 中,我尝试导入一个名为 foo.py 的模块,该模块具有类型提示 stub file foo.pyi. I want to get code autocompletion based on the type hints in the .pyi file, as PyCharm does。但是,.pyi 文件似乎没有任何作用。有谁知道是否支持此功能?

如果您使用 Pylance language server 应该支持它,它将设置 "python.languageServer": "Pylance" 作为安装它的副作用。