diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index a5318358443..6c4e83d21d5 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -527,7 +527,7 @@ export interface IDebugService { /** * Creates a new debug process. Depending on the configuration will either 'launch' or 'attach'. */ - createProcess(config: IConfig): TPromise; + createProcess(config: IConfig): TPromise; /** * Restarts a process or creates a new one if there is no active session. diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 7b7dec560c6..4203e733342 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -664,7 +664,7 @@ export class DebugService implements debug.IDebugService { )); } - public createProcess(config: debug.IConfig): TPromise { + public createProcess(config: debug.IConfig): TPromise { return this.textFileService.saveAll().then(() => this.configurationManager.resloveConfiguration(config).then(resolvedConfig => { if (!resolvedConfig) { @@ -724,7 +724,7 @@ export class DebugService implements debug.IDebugService { ); } - private doCreateProcess(configuration: debug.IConfig): TPromise { + private doCreateProcess(configuration: debug.IConfig): TPromise { const sessionId = generateUuid(); this.updateStateAndEmit(sessionId, debug.State.Initializing); @@ -817,8 +817,8 @@ export class DebugService implements debug.IDebugService { extensionName: `${adapter.extensionDescription.publisher}.${adapter.extensionDescription.name}`, isBuiltin: adapter.extensionDescription.isBuiltin, launchJsonExists: !!this.configurationService.getConfiguration('launch') - }); - }).then(undefined, (error: any) => { + }).then(() => process); + }).then(p => p, (error: any) => { if (error instanceof Error && error.message === 'Canceled') { // Do not show 'canceled' error messages to the user #7906 return TPromise.as(null);