From 9da6e83d99334a68ec90f9adcffbd700b406d61a Mon Sep 17 00:00:00 2001 From: Eyal Barlev Date: Tue, 18 Jun 2019 08:00:44 +0000 Subject: [PATCH] use fork instead of spawn Signed-off-by: Eyal Barlev --- .../vscode-debug-adapter-contribution.ts | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/debug/src/node/vscode/vscode-debug-adapter-contribution.ts b/packages/debug/src/node/vscode/vscode-debug-adapter-contribution.ts index a9a8194f39a56..4a9beb6825b74 100644 --- a/packages/debug/src/node/vscode/vscode-debug-adapter-contribution.ts +++ b/packages/debug/src/node/vscode/vscode-debug-adapter-contribution.ts @@ -229,12 +229,22 @@ export abstract class AbstractVSCodeDebugAdapterContribution implements DebugAda if (runtime && runtime.indexOf('./') === 0) { runtime = path.join(this.extensionPath, runtime); } + const runtimeArgs = info && info.runtimeArgs || contribution.runtimeArgs || []; - const command = runtime ? runtime : program; - const args = runtime ? [...runtimeArgs, program, ...programArgs] : programArgs; - return { - command, - args - }; + if (runtime === 'node') { + const modulePath = program; + const args = [...runtimeArgs, ...programArgs]; + return { + modulePath, + args + }; + } else { + const command = runtime ? runtime : program; + const args = runtime ? [...runtimeArgs, program, ...programArgs] : programArgs; + return { + command, + args + }; + } } }