问题
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?
回答1:
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)
来源:https://stackoverflow.com/questions/62224884/how-to-make-vscodes-python-debugger-skip-stepping-into-some-modules-when-debugg