launch.json breaks debugging in VSCode

Question:

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 tough.

What should I modify?

Asked By: shamalaia

||

Answers:

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:

enter image description here

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
Answered By: MingJie-MSFT