diff --git a/src/vs/workbench/parts/debug/browser/debugActions.ts b/src/vs/workbench/parts/debug/browser/debugActions.ts index b44fded2b4d..e22b376cc26 100644 --- a/src/vs/workbench/parts/debug/browser/debugActions.ts +++ b/src/vs/workbench/parts/debug/browser/debugActions.ts @@ -214,7 +214,7 @@ export class StopDebugAction extends AbstractDebugAction { public run(): Promise { var session = this.debugService.getActiveSession(); - return session ? session.stop() : Promise.as(null); + return session ? session.disconnect() : Promise.as(null); } protected isEnabled(): boolean { diff --git a/src/vs/workbench/parts/debug/common/debug.ts b/src/vs/workbench/parts/debug/common/debug.ts index 2053c6d27a5..5dcdeb96dc0 100644 --- a/src/vs/workbench/parts/debug/common/debug.ts +++ b/src/vs/workbench/parts/debug/common/debug.ts @@ -213,10 +213,8 @@ export interface IRawAdapter extends IRawEnvAdapter { } export interface IRawDebugSession extends ee.EventEmitter { - initialize(args: DebugProtocol.InitializeRequestArguments): TPromise; - launch(args: DebugProtocol.LaunchRequestArguments): TPromise; - attach(args: DebugProtocol.AttachRequestArguments): TPromise; - stop(restart?: boolean): TPromise; + getType(): string; + disconnect(restart?: boolean): TPromise; next(args: DebugProtocol.NextArguments): TPromise; stepIn(args: DebugProtocol.StepInArguments): TPromise; @@ -224,18 +222,9 @@ export interface IRawDebugSession extends ee.EventEmitter { continue(args: DebugProtocol.ContinueArguments): TPromise; pause(args: DebugProtocol.PauseArguments): TPromise; - setBreakpoints(args: DebugProtocol.SetBreakpointsArguments): TPromise; - setExceptionBreakpoints(args: DebugProtocol.SetExceptionBreakpointsArguments): TPromise; - stackTrace(args: DebugProtocol.StackTraceArguments): TPromise; scopes(args: DebugProtocol.ScopesArguments): TPromise; variables(args: DebugProtocol.VariablesArguments): TPromise; - source(args: DebugProtocol.SourceArguments): TPromise; - threads(): TPromise; evaluate(args: DebugProtocol.EvaluateArguments): TPromise; - - getLengthInSeconds(): number; - getType(): string; - emittedStopped: boolean; } export var IDebugService = createDecorator(DEBUG_SERVICE_ID); diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index b6bd91c4a86..62c560dadc3 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -66,7 +66,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService private taskService: ITaskService; private state: debug.State; - private session: debug.IRawDebugSession; + private session: session.RawDebugSession; private model: model.Model; private viewModel: viewmodel.ViewModel; private toDispose: lifecycle.IDisposable[]; @@ -241,7 +241,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService if (extensionHostData) { this.restartSession(extensionHostData).done(null, errors.onUnexpectedError); } else if (this.session) { - this.session.stop().done(null, errors.onUnexpectedError); + this.session.disconnect().done(null, errors.onUnexpectedError); } })); @@ -553,7 +553,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService }).then(undefined, (error: Error) => { this.telemetryService.publicLog('debugMisconfiguration', { type: this.configuration ? this.configuration.type : undefined }); if (this.session) { - this.session.stop(); + this.session.disconnect(); } return Promise.wrapError(errors.create(error.message, { actions: [CloseAction, this.instantiationService.createInstance(debugactions.ConfigureAction, debugactions.ConfigureAction.ID, debugactions.ConfigureAction.LABEL)] })); @@ -597,7 +597,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService } public restartSession(extensionHostData?: any): Promise { - return this.session ? this.session.stop(true).then(() => { + return this.session ? this.session.disconnect(true).then(() => { new Promise(c => { setTimeout(() => { this.createSession(extensionHostData, false).then(() => c(true)); @@ -814,7 +814,7 @@ export class DebugService extends ee.EventEmitter implements debug.IDebugService public dispose(): void { if (this.session) { - this.session.stop(); + this.session.disconnect(); this.session = null; } this.model.dispose(); diff --git a/src/vs/workbench/parts/debug/node/rawDebugSession.ts b/src/vs/workbench/parts/debug/node/rawDebugSession.ts index cc2420f6403..8ba4f45275b 100644 --- a/src/vs/workbench/parts/debug/node/rawDebugSession.ts +++ b/src/vs/workbench/parts/debug/node/rawDebugSession.ts @@ -117,7 +117,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes return this.send('pause', args); } - public stop(restart = false): TPromise { + public disconnect(restart = false): TPromise { if ((this.serverProcess || this.socket) && !this.stopServerPending) { this.stopServerPending = true; // point of no return: from now on don't report any errors return this.send('disconnect', { extensionHostData: { restart: restart } }).then(() => {