From 4c8820c14d8974d4bc4cbbbbef0e1682fd0e3778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Rodrigues?= Date: Wed, 13 Mar 2019 13:22:42 -0300 Subject: [PATCH] Added new option to keep ruby process when disconnect request --- package.json | 5 +++++ src/debugger/interface.ts | 2 ++ src/debugger/main.ts | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index ed19b4b01..aa85bb5ab 100644 --- a/package.json +++ b/package.json @@ -685,6 +685,11 @@ "type": "boolean", "description": "Show output of the debugger in the console.", "default": false + }, + "keepRubyProcessOnDisconnect": { + "type": "boolean", + "description": "Keep ruby process on disconnect request.", + "default": false } } } diff --git a/src/debugger/interface.ts b/src/debugger/interface.ts index a757a8b7a..794f1aea8 100644 --- a/src/debugger/interface.ts +++ b/src/debugger/interface.ts @@ -27,6 +27,8 @@ export interface AttachRequestArguments extends DebugProtocol.AttachRequestArgum remoteWorkspaceRoot?: string; /** Show debugger process output. If not specified, there will only be executable output */ showDebuggerOutput?: boolean; + /** Keep ruby process on disconnect request */ + keepRubyProcessOnDisconnect?: boolean; } export interface IRubyEvaluationResult { diff --git a/src/debugger/main.ts b/src/debugger/main.ts index 03e82a6d9..991d35010 100644 --- a/src/debugger/main.ts +++ b/src/debugger/main.ts @@ -452,7 +452,7 @@ class RubyDebugSession extends DebugSession { } protected disconnectRequest(response: DebugProtocol.DisconnectResponse, args: DebugProtocol.DisconnectArguments) { - if (this.rubyProcess.state !== SocketClientState.closed) { + if (!this.requestArguments.keepRubyProcessOnDisconnect && this.rubyProcess.state !== SocketClientState.closed) { this.rubyProcess.Run('quit'); } this.sendResponse(response);