Debugging Issues using VS Code


Windows version: 10.0.19045
Slicer Version: 4.11.20200930 r29402 / 002be18
VS Code version: 1.87.2

in order to make a debugging in VS Code using the Python debugger module of Slicer I´ve followed the instructrions written in GitHub - SlicerRt/SlicerDebuggingTools: Extension for 3D Slicer containing various tools for module development and debugging
I’ve saved the following simple script into the working directory:
for i in range(3):

I’ve started the connection with the debug server in the Slicer and after that the debugging in VS Code. The process seem to work (at least I haven’t got any error messages), however at the debugging tab the buttons step over, step into and step out are greyed out. I can place breakpoints into the script, but the debugging itself does not work. Any suggestions how I can fix this problem? Thanks in advance. Istvan

Your script is executed line-by-line, so breakpoints will not work there. However, you don’t really need it, as you can just use the Python console or Jupyter notebooks (SlicerJupyter extension) to run code snippets and inspect the results.

You can use breakpoints when debugging code in your module. When you make any modifications then you can reload the module by a single click.