gpt4 book ai didi

python - 在 python 中,VSCode 调试器不会进入外部代码。不知道如何在 launch.json 中编辑 "justMyCode"

转载 作者:行者123 更新时间:2023-12-03 19:23:06 50 4
gpt4 key购买 nike

我一直在指https://code.visualstudio.com/docs/python/debugging#_justmycode

How to disable "just my code" setting in VSCode debugger?

尽管尝试了很多,仍然无法弄清楚该放在哪里
“justMyCode”:launch.json 中的 false。我试图把它放在任何地方,编辑器都会说“不允许使用 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
}
]
}

最佳答案

还不够Try setting "justMyCode": false正如 VS Code 调试器中的消息所暗示的那样。您还需要更改"request": "launch""request": "test"如果你想单步执行外部代码。这是the Github issue where I found this answer .

关于python - 在 python 中,VSCode 调试器不会进入外部代码。不知道如何在 launch.json 中编辑 "justMyCode",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58687113/

50 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com