mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
debug: trim down IRawDebugSession
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -213,10 +213,8 @@ export interface IRawAdapter extends IRawEnvAdapter {
|
||||
}
|
||||
|
||||
export interface IRawDebugSession extends ee.EventEmitter {
|
||||
initialize(args: DebugProtocol.InitializeRequestArguments): TPromise<DebugProtocol.InitializeResponse>;
|
||||
launch(args: DebugProtocol.LaunchRequestArguments): TPromise<DebugProtocol.LaunchResponse>;
|
||||
attach(args: DebugProtocol.AttachRequestArguments): TPromise<DebugProtocol.AttachResponse>;
|
||||
stop(restart?: boolean): TPromise<DebugProtocol.DisconnectResponse>;
|
||||
getType(): string;
|
||||
disconnect(restart?: boolean): TPromise<DebugProtocol.DisconnectResponse>;
|
||||
|
||||
next(args: DebugProtocol.NextArguments): TPromise<DebugProtocol.NextResponse>;
|
||||
stepIn(args: DebugProtocol.StepInArguments): TPromise<DebugProtocol.StepInResponse>;
|
||||
@@ -224,18 +222,9 @@ export interface IRawDebugSession extends ee.EventEmitter {
|
||||
continue(args: DebugProtocol.ContinueArguments): TPromise<DebugProtocol.ContinueResponse>;
|
||||
pause(args: DebugProtocol.PauseArguments): TPromise<DebugProtocol.PauseResponse>;
|
||||
|
||||
setBreakpoints(args: DebugProtocol.SetBreakpointsArguments): TPromise<DebugProtocol.SetBreakpointsResponse>;
|
||||
setExceptionBreakpoints(args: DebugProtocol.SetExceptionBreakpointsArguments): TPromise<DebugProtocol.SetExceptionBreakpointsResponse>;
|
||||
stackTrace(args: DebugProtocol.StackTraceArguments): TPromise<DebugProtocol.StackTraceResponse>;
|
||||
scopes(args: DebugProtocol.ScopesArguments): TPromise<DebugProtocol.ScopesResponse>;
|
||||
variables(args: DebugProtocol.VariablesArguments): TPromise<DebugProtocol.VariablesResponse>;
|
||||
source(args: DebugProtocol.SourceArguments): TPromise<DebugProtocol.SourceResponse>;
|
||||
threads(): TPromise<DebugProtocol.ThreadsResponse>;
|
||||
evaluate(args: DebugProtocol.EvaluateArguments): TPromise<DebugProtocol.EvaluateResponse>;
|
||||
|
||||
getLengthInSeconds(): number;
|
||||
getType(): string;
|
||||
emittedStopped: boolean;
|
||||
}
|
||||
|
||||
export var IDebugService = createDecorator<IDebugService>(DEBUG_SERVICE_ID);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -117,7 +117,7 @@ export class RawDebugSession extends v8.V8Protocol implements debug.IRawDebugSes
|
||||
return this.send('pause', args);
|
||||
}
|
||||
|
||||
public stop(restart = false): TPromise<DebugProtocol.DisconnectResponse> {
|
||||
public disconnect(restart = false): TPromise<DebugProtocol.DisconnectResponse> {
|
||||
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(() => {
|
||||
|
||||
Reference in New Issue
Block a user