Vscode-ruby: Feature request: Attaching debugger to existing process

Created on 10 Mar 2017  Â·  5Comments  Â·  Source: rubyide/vscode-ruby

The latest (beta) versions of ruby-debug-ide have support for attaching a Ruby debugger to existing processes. A nice implementation is done in Rubymine, where you can get a list of currently running ruby processes and select one to attach a debugger to. It works flawless on OS X, whether I attach to a rails server, Sidekiq, even a Zeus slave, and the nice thing is, killing the debugger detaches it again, making the original process go as fast as it went before the debugger was attached.

It would be super awesome to be able to do the same in VSCode, and I think – since the code is already there in the ruby-debug-ide gem – it should be manageable to do. Also, this will solve any problem people have with the debugger not finding the right environment (e.g. with rvm in a custom gemset).

feature-request

All 5 comments

VS Code has the process picker UI so the only missing part is this extension :) Nice suggestion.

Perhaps this might fix #163?

Closing for issue cleanup. Apologies if this is still an issue. We are working to improve the core extension experience.

@wingrunr21 This is still an issue. Please fix it. It's a really simple change:

diff --git a/packages/vscode-ruby-debugger/src/main.ts b/packages/vscode-ruby-debugger/src/main.ts
index bd3ec94..e859e13 100644
--- a/packages/vscode-ruby-debugger/src/main.ts
+++ b/packages/vscode-ruby-debugger/src/main.ts
@@ -508,7 +508,11 @@ class RubyDebugSession extends DebugSession {

     protected disconnectRequest(response: DebugProtocol.DisconnectResponse, args: DebugProtocol.DisconnectArguments) {
         if (this.rubyProcess.state !== SocketClientState.closed) {
-            this.rubyProcess.Run('quit');
+            if (this.debugMode === Mode.launch) {
+                this.rubyProcess.Run('quit');
+            } else {
+                this.rubyProcess.Run('detach');
+            }
         }
         this.sendResponse(response);
     }

@firelizzard18 This wasn't a bug, this was a feature request. I think you've commented in the wrong issue.

@wingrunr21 Can we reopen this one please? I really think this is something that's going to be useful for virtually everyone who uses Ruby with resident processes (incl. all Rails devs)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

clxy picture clxy  Â·  3Comments

ghost picture ghost  Â·  4Comments

ckruse picture ckruse  Â·  5Comments

wingrunr21 picture wingrunr21  Â·  4Comments

Snake-Sanders picture Snake-Sanders  Â·  4Comments