1.核心解决办法:修改launch.json。
2.launch.json文件再哪里?
鼠标左击齿轮图标,launch.json文件会自动打开。
3.如何修改launch.json文件:
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
"purpose": ["debug-in-terminal"]
}
]
}
首先justMyCode要设置成false,另外还要加上"purpose": [“debug-in-terminal”]。这个purpose的作用就是:告诉扩展在测试调试或使用debug-in-terminal命令时使用此配置。这样可以看到非本项目的代码,例如detetrons2中的源代码。