Launching PTVSD debugger from VS Code #40
Comments
The only reason why If it's convenient for VSC to use the same script, we could move it to this repo, so that it's shared between the two. But I suspect there would be differences e.g. wrt locating the package, so it's probably easier to keep separate scripts for each - they're small enough. This would also mean that you can optimize the script's command line interface to be more convenient specifically for VSC launcher. |
Agreed. Just wanted to ensure that we're all on the same page. I've tried using the launcher script in VS Code and it doesn't work. When launching ptvsd module ( Anyways, I'll proceed without this launcher script. Once again, thanks. |
With respect to direction of connection, you might want to consider making it work the same as in VS (i.e. the debuggee connects to the IDE). The main reason is that it allows the IDE to pick any available ephemeral port first and open a server there (thereby claiming it), and then telling the script where it should connect via command line arguments. When it's the other way around, you basically have to hardcode the port, since the script doesn't have any means to communicate a randomly picked port to the IDE without a connection; so it might fail if the port is already in use. |
Got it. |
In making that architectural change, I can use
Please could you make this change. Will create a separate issue for that. |
After having a chat with @karthiknadig I learnt that I dont and can't use
ptvsd_launcher.py
found in PTVS (Visual Studio), instead I can just use thePTVSD
module.This works, and I'm able to get the debugger working in VS Code as follows:
python -m ptvsd --port 8788 --file main.py
However,
ptvsd_launcher.py
does a lot more than just launching the debugger.All of this is done and necessary stuff then passed onto PTVSD (
debug
function indebugger.py
).With VS Code not utilizing
ptvsd_launcher.py
, it feels like the responsibility falls on VS Code (our adapter) to to the above.@ericsnowcurrently @int19h @karthiknadig
Please could someone confirm this.
The text was updated successfully, but these errors were encountered: