microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.67k stars 770 forks source link

Pybind11 generated stubs discovery? #6019

Open martincerven opened 1 week ago

martincerven commented 1 week ago

I want to use autocomplete with library which uses pybin11: https://github.com/isl-org/Open3D The only way to get type hints is to generate stubs with: https://github.com/sizmailov/pybind11-stubgen Now, it works if I put the generated typings folder with:

pybind11-stubgen open3d -o typings

in the workspace root, or change

"python.analysis.stubPath"

To point to generated folder.

What if I want to generate typings inside package itself in sites-packages to not pollute my workspace? What if I have multiple pybind11 projects? the "python.analysis.stubPath" only accepts string not list of paths.

heejaechang commented 1 week ago

you could contribute to https://github.com/microsoft/python-type-stubs then we could bundle it to pylance if quality of stub is good.

otherwise, is your asking a way to provide your own stub path that can be shared between multiple vscodes?