[英]In python, VSCode debugger won't step into external code. Can't figure out how to edit "justMyCode" in launch.json
I have been referring tohttps://code.visualstudio.com/docs/python/debugging#_justmycode and How to disable "just my code" setting in VSCode debugger?我一直在参考https://code.visualstudio.com/docs/python/debugging#_justmycode和如何在 VSCode 调试器中禁用“只是我的代码”设置?
Despite many attempts, still unable to figure out where to put "justMyCode": false in launch.json.尽管进行了多次尝试,但仍然无法弄清楚在 launch.json 中将“justMyCode”:false 放在哪里。 Everywhere I try to put it the editor says "Property justMyCode is not allowed "
我试图把它放在任何地方,编辑器都会说“不允许使用属性 justMyCode”
Below is a copy of my launch.json.下面是我的launch.json的副本。 Can someone tell me what should I do?
有人可以告诉我该怎么做吗?
{
// 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
}
]
}
It's not enough to Try setting "justMyCode": false
as the message in the VS Code debugger suggests.正如 VS Code 调试器中的消息所暗示的那样,
Try setting "justMyCode": false
是不够的。 You also need to change "request": "launch"
to "request": "test"
if you want to step through external code.如果要单步执行外部代码,还需要将
"request": "launch"
更改为"request": "test"
。 Here's the Github issue where I found this answer .这是我找到这个答案的 Github 问题。
you need to put "purpose": ["debug-test"]
too.您也需要输入
"purpose": ["debug-test"]
。
like喜欢
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false,
"purpose": ["debug-test"]
}
],
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.