mitsuba-renderer / nanogui

Minimalistic C++/Python GUI library for OpenGL, GLES2/3, Metal, and WebAssembly/WebGL
Other
1.57k stars 196 forks source link

Python IDE Autocomplete (stub files?) #79

Open tcdtech opened 3 years ago

tcdtech commented 3 years ago

Are there any existing solutions to getting autocomplete/intellisense/code completion working properly with nanogui?

I use VSCode/Visual Studio and neither parse compiled pyd files for code completion, they require accompanying .pyi stub files.

I spent a couple of hours playing with mypy.stubgen and pybind11-stubgen. Both seem to have potential but in the time I gave myself I couldn't get either to run without errors.

I thought I'd ask if anyone else has successfully generated stub files (or has another solution to the problem) before potentially wasting anymore time on it.

cansik commented 1 year ago

Still a big issue in python to use the library. Did you successfully generate the stubs?

cansik commented 1 year ago

@tcdtech Since my last comment, I wrote a tool called nanobind-stubgen to generate stubs for nanogui and other nanobind based libraries. Due to the fact that nanobind puts the function signature into the __doc__ string, it was quite easy to generate the pyi files. I have tested it with nanogui and nanobind_example. It is still under development, but ready to generate nanogui stubs for code completion.