vscode-rdbg icon indicating copy to clipboard operation
vscode-rdbg copied to clipboard

Feature Request: Launch-then-attach Launch Configuration

Open ccutrer opened this issue 1 year ago • 5 comments

The launch configuration is very useful for starting a new process and debugging it. But it currently requires the process to be launched via rdbg. The attach configuration is more flexible, in that whatever hoops you need to jump through to get the process started are outside of the extension's purview (running inside of docker, via an optimized launcher like spring, etc.) - it just needs to know how to connect to it. I'd love to be able to use the best of both worlds... a "launch" config with something like "bareCommand": true that doesn't wrap the command in rdbg, and then remotely attaches once the socket/port is available.

ccutrer avatar Sep 26 '23 21:09 ccutrer

For now I'm working around this by setting rdbgPath to a custom script that doesn't actually launch rdbg, but does capture the arguments to it and passes them through the process launch, and then when the process is running it requires rdbg itself.

ccutrer avatar Sep 27 '23 16:09 ccutrer

I'm in the same boat (do all my dev work in containers). I just want to attach to a container that I launched with whatever command I choose.

@ccutrer I would love to see the script you wrote to work around this!

kwerle avatar Nov 13 '23 23:11 kwerle

I'm in the same boat (do all my dev work in containers). I just want to attach to a container that I launched with whatever command I choose.

@ccutrer I would love to see the script you wrote to work around this!

Me too!

machty avatar Nov 30 '23 02:11 machty

I got something working, based on @ccutrer's idea of custom script that rdbgPath points to:

https://gist.github.com/machty/7e08afc32e1a82c60a85141afdf84ebd

With this, I can run the launch command "Run rspec at current line", and it'll spin up rspec via the springified rspec binstub I'm in the habit of using. So as far as I can tell, this is the best of both all worlds: 1. fast string of rspec via spring, 2. rdbg (rather than binding.pry)

machty avatar Nov 30 '23 08:11 machty

@machty That's nice - but it doesn't solve the issue of firing up a container and attaching to it - does it?

kwerle avatar Nov 30 '23 17:11 kwerle