Search code examples
pythonvisual-studio-codepython-typingmypy

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. I want to get code autocompletion based on the type hints in the .pyi file, as PyCharm does. However, the .pyi file does not seem to have any effect. Does anyone know if this feature is supported?


Solution

  • It should be supported if you use the Pylance language server which will set "python.languageServer": "Pylance" as a side-effect of installing it.