VSCode中launch.json配置致调试失效,求修改方案
问题修复方案
你的launch.json存在两个关键问题导致调试器无法启动:
- JSON语法错误:
"justMyCode": false,末尾多余的逗号会触发JSON解析失败,这是最直接的原因。 - 配置项放错位置:
debug.allowBreakpointsEverywhere和jupyter.debugJustMyCode是VSCode的全局设置,不属于launch.json的配置范围,应该放在.vscode/settings.json中。
修改后的launch.json
{ "configurations": [ { "name": "Python: Current File", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal", "env": {"PYDEVD_WARN_SLOW_RESOLVE_TIMEOUT": "5"}, "justMyCode": false } ] }
对应的settings.json(如果没有则新建)
{ "debug.allowBreakpointsEverywhere": true, "jupyter.debugJustMyCode": false }
修改完成后重启VSCode的调试会话即可正常启动调试器。
内容的提问来源于stack exchange,提问作者shamalaia
相关产品推荐
相关产品推荐

