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

℡╲_俬逩灬. 提交于 2021-01-29 06:26:46

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!