Clo*_*oud 8 python visual-studio-code
我一直在参考https://code.visualstudio.com/docs/python/debugging#_justmycode 以及 如何在 VSCode 调试器中禁用“仅我的代码”设置?
尽管进行了多次尝试,仍然无法弄清楚在 launch.json 中将 "justMyCode": false 放在哪里。在我尝试添加它的每个地方,编辑器都会说“不允许使用 Property justMyCode ”
下面是我的 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 (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
},
{
"name": "Python: Remote Attach",
"type": "python",
"request": "attach",
"port": 5678,
"host": "localhost",
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
"remoteRoot": "."
}
]
},
{
"name": "Python: Module",
"type": "python",
"request": "launch",
"module": "enter-your-module-name-here",
"console": "integratedTerminal"
},
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"console": "integratedTerminal",
"args": [
"runserver",
"--noreload",
"--nothreading"
],
"django": true
},
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"module": "flask",
"env": {
"FLASK_APP": "app.py"
},
"args": [
"run",
"--no-debugger",
"--no-reload"
],
"jinja": true
},
{
"name": "Python: Current File (External Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "externalTerminal"
},
{
"name": "Debug Unit Test",
"type": "python",
"request": "attach",
"justMyCode": false
}
]
}
Run Code Online (Sandbox Code Playgroud)
小智 7
Try setting "justMyCode": false正如 VS Code 调试器中的消息所示,这还不够。如果您想单步执行外部代码,您还需要更改"request": "launch"为。"request": "test"这是我在 Github 上找到答案的问题。
小智 5
你也需要放"purpose": ["debug-test"]。
喜欢
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
"purpose": ["debug-test"]
}
],
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6788 次 |
| 最近记录: |