vimspector/support/test/python/simple_python/.vimspector.json
Ben Jackson 0942aa4523 Fix docker example for python
The example was was using 'launchCommand' which is not valid according
to the schema; it should be 'runCommand'.

But also, it never really worked. Vimspector would start the "adapter"
(in this case, try and connect to the TCP port) before running the
"prepare" commands, wich in this case would actually start debugpy
listening. So to solve that we run the prepare commands earlier.
Hopefully this won't cause a regression for Java and C++ remote attach,
which we don't really have tests for.

Finally, due to the way docker works, when you forward a port and
nothing is listening on it, docker _accepts_ the connection then
immediately drops it. This is _super_ annoying meaning that it looks to
vimspector liek the server instantly dies if it takes nonzero time for
the remote commands to open the port. So to solve this we add loaunch
and attach delays which can be configured in the adapter config. This
actually solves a prolem where the java debugger just takes agest to
attach on remote launch too.

(Finally, finally...) updated the vimspector schema to represent
the real launch/attach remote configuration, which was incorrectly
spec'd at the adapter level, but it's actually per launch/attach block.
2020-12-22 15:45:26 +00:00

169 lines
4 KiB
JSON

{
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json",
"adapters": {
"run_with_debugpy": {
"command": [ "${workspaceRoot}/run_with_debugpy" ],
"port": 9876,
"env": {
"DEBUG_PORT": "9876"
}
},
"python-remote-docker": {
"variables": {
"port": "8765"
},
"port": "${port}",
"launch": {
"remote": {
"container": "${ContainerID}",
"runCommand": [
"python3", "-m", "debugpy", "--listen", "0.0.0.0:${port}",
"--wait-for-client",
"%CMD%"
]
},
"delay": "5000m"
}
}
},
"configurations": {
"Use custom gadget": {
"adapter": "test_custom",
"configuration": {
"request": "launch"
}
},
// This is a comment.
"run legacy vscode-python": {
"adapter": "vscode-python", /* coment goes here too */
"configuration": {
"request": "launch",
"type": "python",
"cwd": "${workspaceRoot}",
"program": "${file}",
"stopOnEntry": true,
"console": "integratedTerminal"
},
"breakpoints": {
"exception": {
"raised": "N",
"uncaught": "",
"userUnhandled": ""
}
}
},
"attach": {
"adapter": "multi-session",
"configuration": {
"request": "attach"
},
"breakpoints": {
"exception": {
"raised": "N",
"uncaught": "",
"userUnhandled": ""
}
}
},
"attach-run": {
"adapter": "run_with_debugpy",
"configuration": {
"request": "attach"
},
"breakpoints": {
"exception": {
"raised": "N",
"uncaught": "",
"userUnhandled": ""
}
}
},
"docker-attach": {
"adapter": "python-remote-docker",
"remote-cmdLine": [ "/root/main.py" ],
"remote-request": "launch",
"configuration": {
"request": "attach",
"pathMappings": [
{
"localRoot": "${workspaceRoot}",
"remoteRoot": "/root"
}
]
}
},
"run": {
"adapter": "debugpy",
"configuration": {
"request": "launch",
"type": "python",
"cwd": "${workspaceRoot}",
"program": "${file}",
"stopOnEntry": false,
"console": "integratedTerminal"
},
"breakpoints": {
"exception": {
"raised": "N",
"uncaught": "",
"userUnhandled": ""
}
}
},
"run - default": {
"adapter": "debugpy",
"variables": {
"MAKE_ENV_OUTPUT": {
"shell": "${workspaceRoot}/make_env.sh"
}
},
"configuration": {
"request": "launch",
"type": "python",
"cwd": "${workspaceRoot}",
"program": "${program:${file\\}}",
"stopOnEntry#json": "${StopOnEntry:true}",
"console": "integratedTerminal",
"args#json": "${args:[]}",
"igored#json#s": "string not json",
"env#json": "${MAKE_ENV_OUTPUT}"
},
"breakpoints": {
"exception": {
"raised": "N",
"uncaught": "",
"userUnhandled": ""
}
}
},
"run - main.py": {
"adapter": "debugpy",
"configuration": {
"request": "launch",
"type": "python",
"cwd": "${workspaceRoot}",
"program": "${workspaceRoot}/main.py",
"stopOnEntry": false,
"console": "integratedTerminal"
},
"breakpoints": {
"exception": {
"raised": "N",
"uncaught": "",
"userUnhandled": ""
}
}
},
"run - exception question": {
"adapter": "debugpy",
"configuration": {
"request": "launch",
"type": "python",
"cwd": "${workspaceRoot}",
"program": "${file}",
"stopOnEntry": false,
"console": "integratedTerminal"
}
}
}
}