launch.json breaks debugging in VSCode

huangapple go评论66阅读模式
英文:

launch.json breaks debugging in VSCode

问题

I wanted to set justMyCode to false for a python project in VSCode.
So I created a launch.json file in a .vscode folder under the project root folder with the following content:

{
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal", // <= adding/deleting this makes no difference
            "env": {"PYDEVD_WARN_SLOW_RESOLVE_TIMEOUT": "5"}, // <= I'd like to have this too
            "justMyCode": false,
        }
    ],
    "debug.allowBreakpointsEverywhere": true,
    "jupyter.debugJustMyCode": false,
}

Afterwards, the debugger won't start. The code runs fine outside the debugging though.

What should I modify?

英文:

I wanted to set justMyCode to false for a python project in VSCode.
So I created a launch.json file in a .vscode folder under the project root folder with the following content:

{
    &quot;configurations&quot;: [
        {
            &quot;name&quot;: &quot;Python: Current File&quot;,
            &quot;type&quot;: &quot;python&quot;,
            &quot;request&quot;: &quot;launch&quot;,
            &quot;program&quot;: &quot;${file}&quot;,
            &quot;console&quot;: &quot;integratedTerminal&quot;, // &lt;== adding/deleting this makes no difference
            &quot;env&quot;: {&quot;PYDEVD_WARN_SLOW_RESOLVE_TIMEOUT&quot;: &quot;5&quot;}, // &lt;== I&#39;d like to have this too
            &quot;justMyCode&quot;: false,
        }
    ],
    &quot;debug.allowBreakpointsEverywhere&quot;: true,
    &quot;jupyter.debugJustMyCode&quot;: false,
}

Afterwards, the debugger won't start. The code runs fine outside the debugging tough.

What should I modify?

答案1

得分: 1

如rioV8所说,通过右上角的调试Python文件按钮进行调试将不会读取launch.json中的配置。

您可以使用快捷键F5或单击下图中的按钮:

launch.json breaks debugging in VSCode

一些相关的补充信息:

运行选项 .env设置 launch.json设置
在终端中运行Python文件
在交互式窗口中运行
通过F5进行调试
“调试Python文件” (*)
英文:

As rioV8 said, debugging through the Debug Python File button in the upper right corner will not read the configuration in launch.json.

You can use shortcuts F5 or click the following button in the picture:

launch.json breaks debugging in VSCode

Some relevant supplementary information:

Run option .env setting launch.json setting
Run Python file in terminal no no
Run in interactive Window yes no
Debug via F5 yes yes
"Debug Python File" (*) yes no

huangapple
  • 本文由 发表于 2023年3月1日 15:37:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75600734.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定