Autocomplete code lines for slicer in an IDE?

new to slicer development, saw this tutorial and they seem to use an IDE that supports autocompleting statements unique to slicer as in the python interactor:

what IDE could i use for that feature ( or how to add slicer API support to IDEs like pycharm?)
Thanks for your help.

The easiest and most robust way of getting auto-complete in an IDE is to attach a Python debugger put a breakpoint in the code where you want to add more code, and make the code stop there.

Auto-complete without debugging relies on static code analysis, which does not work very well for the dynamically constructed Python-wrapped C++ objects that Slicer and its libraries use, but you can give it a try. Specify “PythonSlicer” executable as your Python interpreter for the IDE. I’ve found that Eclipse (LiClipse) auto-complete and documentation lookup works reasonable well. Last time I tried, PyCharm’s skeleton generation failed for many components. I have reported the issue, but there was no follow-up. The issue can be fixed manually by patching of the skeleton generator, but maybe Python wrapping of VTK should be improved instead to make it more friendly to current IDEs.

1 Like

i will try that, thanks a lot!!

Would have some more specific feedback regarding this ?

I think this is already on David Gobbi’s radar - see for example https://discourse.vtk.org/t/vtk-8-2-python-and-vscode/704/3

1 Like