Louis Shraga
Louis Shraga

Reputation: 803

How to make VSCode's python debugger skip stepping into some modules when debugging

In vscode's python (ms-python) extension, is there a way to make the debugger (debugpy) not to step-into functions defined in specific modules. I have found justMyCode but it will skip entering into external modules only (like members of stdlib) while I need to skip my own modules sometimes.

I saw some debug adaptors for some other languages implement skipFiles property. Is there anything similar for python?

Upvotes: 5

Views: 1886

Answers (1)

Louis Shraga
Louis Shraga

Reputation: 803

Going thru debugpy code I found this undocumented feature which works like a charm: in launch.json's debug configuration add "rules" : [{"module":"*xxx*", "include":false}]. Make sure the xxx is the full module name like a.b.module

There are more working options. They can be seen here

A word of warning. This feature is undocumented (at least I did not find it anywhere) so use with caution as it might disappear one day. At the other hand, this feature is properly tested as part of the code uni-testing (as you can see from the link)

Upvotes: 7

Related Questions