From 93dd7be4b1e0f9f3df5ba61196788c81b9ddcfe2 Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Mon, 24 Jul 2017 10:21:14 +0200 Subject: [PATCH] call createSession command with root folder --- .../parts/debug/electron-browser/debugService.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index f953ef7a9b9..640e9b4aebe 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -646,6 +646,14 @@ export class DebugService implements debug.IDebugService { } public startDebugging(configOrName?: debug.IConfig | string, noDebug = false): TPromise { + + // temporary workaround: the folderUri should be an argument to startDebugging + let folderUri: uri = undefined; + const workspace = this.contextService.getWorkspace(); + if (workspace && workspace.roots.length > 0) { + folderUri = workspace.roots[0]; + } + // make sure to save all files and that the configuration is up to date return this.textFileService.saveAll().then(() => this.configurationService.reloadConfiguration().then(() => this.extensionService.onReady().then(() => { @@ -684,7 +692,7 @@ export class DebugService implements debug.IDebugService { } if (commandAndType && commandAndType.command) { const defaultConfig = noDebug ? { noDebug: true } : {}; - return this.commandService.executeCommand(commandAndType.command, config || defaultConfig).then((result: StartSessionResult) => { + return this.commandService.executeCommand(commandAndType.command, config || defaultConfig, folderUri).then((result: StartSessionResult) => { if (this.contextService.hasWorkspace()) { if (result && result.status === 'initialConfiguration') { return manager.openConfigFile(false, commandAndType.type); -- GitLab