|
@@ -11,8 +11,6 @@ import { PromiseDelegate } from '@phosphor/coreutils';
|
|
|
|
|
|
import { ISignal, Signal } from '@phosphor/signaling';
|
|
|
|
|
|
-import { DebugProtocol } from 'vscode-debugprotocol';
|
|
|
-
|
|
|
import { IDebugger } from './tokens';
|
|
|
|
|
|
export class DebugSession implements IDebugger.ISession {
|
|
@@ -87,23 +85,23 @@ export class DebugSession implements IDebugger.ISession {
|
|
|
* @param command debug command.
|
|
|
* @param args arguments for the debug command.
|
|
|
*/
|
|
|
- async sendRequest<K extends keyof DebugSession.IDebugRequestTypes>(
|
|
|
+ async sendRequest<K extends keyof IDebugger.ISession.IRequest>(
|
|
|
command: K,
|
|
|
- args: DebugSession.IDebugRequestTypes[K]
|
|
|
- ): Promise<DebugSession.IDebugResponseTypes[K]> {
|
|
|
+ args: IDebugger.ISession.IRequest[K]
|
|
|
+ ): Promise<IDebugger.ISession.IResponse[K]> {
|
|
|
const message = await this._sendDebugMessage({
|
|
|
type: 'request',
|
|
|
seq: this._seq++,
|
|
|
command,
|
|
|
arguments: args
|
|
|
});
|
|
|
- return message.content as DebugSession.IDebugResponseTypes[K];
|
|
|
+ return message.content as IDebugger.ISession.IResponse[K];
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Signal emitted for debug event messages.
|
|
|
*/
|
|
|
- get eventMessage(): ISignal<DebugSession, DebugProtocol.Event> {
|
|
|
+ get eventMessage(): ISignal<DebugSession, IDebugger.ISession.IEvent> {
|
|
|
return this._eventMessage;
|
|
|
}
|
|
|
|
|
@@ -118,7 +116,7 @@ export class DebugSession implements IDebugger.ISession {
|
|
|
if (msgType !== 'debug_event') {
|
|
|
return;
|
|
|
}
|
|
|
- const event = message.content as DebugProtocol.Event;
|
|
|
+ const event = message.content as IDebugger.ISession.IEvent;
|
|
|
this._eventMessage.emit(event);
|
|
|
}
|
|
|
|
|
@@ -145,7 +143,9 @@ export class DebugSession implements IDebugger.ISession {
|
|
|
private _disposed = new Signal<this, void>(this);
|
|
|
private _isDisposed: boolean = false;
|
|
|
|
|
|
- private _eventMessage = new Signal<DebugSession, DebugProtocol.Event>(this);
|
|
|
+ private _eventMessage = new Signal<DebugSession, IDebugger.ISession.IEvent>(
|
|
|
+ this
|
|
|
+ );
|
|
|
|
|
|
/**
|
|
|
* Debug protocol sequence number.
|
|
@@ -163,97 +163,4 @@ export namespace DebugSession {
|
|
|
*/
|
|
|
client: IClientSession;
|
|
|
}
|
|
|
-
|
|
|
- export interface IUpdateCellArguments {
|
|
|
- cellId: number;
|
|
|
- nextId: number;
|
|
|
- code: string;
|
|
|
- }
|
|
|
-
|
|
|
- export interface IUpdateCellResponse extends DebugProtocol.Response {
|
|
|
- body: {
|
|
|
- sourcePath: string;
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Interface for all the debug requests types.
|
|
|
- */
|
|
|
- export interface IDebugRequestTypes {
|
|
|
- attach: DebugProtocol.AttachRequestArguments;
|
|
|
- completions: DebugProtocol.CompletionsArguments;
|
|
|
- configurationDone: DebugProtocol.ConfigurationDoneArguments;
|
|
|
- continue: DebugProtocol.ContinueArguments;
|
|
|
- disconnect: DebugProtocol.DisconnectArguments;
|
|
|
- evaluate: DebugProtocol.EvaluateArguments;
|
|
|
- exceptionInfo: DebugProtocol.ExceptionInfoArguments;
|
|
|
- goto: DebugProtocol.GotoArguments;
|
|
|
- gotoTargets: DebugProtocol.GotoTargetsArguments;
|
|
|
- initialize: DebugProtocol.InitializeRequestArguments;
|
|
|
- launch: DebugProtocol.LaunchRequestArguments;
|
|
|
- loadedSources: DebugProtocol.LoadedSourcesArguments;
|
|
|
- modules: DebugProtocol.ModulesArguments;
|
|
|
- next: DebugProtocol.NextArguments;
|
|
|
- pause: DebugProtocol.PauseArguments;
|
|
|
- restart: DebugProtocol.RestartArguments;
|
|
|
- restartFrame: DebugProtocol.RestartFrameArguments;
|
|
|
- reverseContinue: DebugProtocol.ReverseContinueArguments;
|
|
|
- scopes: DebugProtocol.ScopesArguments;
|
|
|
- setBreakpoints: DebugProtocol.SetBreakpointsArguments;
|
|
|
- setExceptionBreakpoints: DebugProtocol.SetExceptionBreakpointsArguments;
|
|
|
- setExpression: DebugProtocol.SetExpressionArguments;
|
|
|
- setFunctionBreakpoints: DebugProtocol.SetFunctionBreakpointsArguments;
|
|
|
- setVariable: DebugProtocol.SetVariableArguments;
|
|
|
- source: DebugProtocol.SourceArguments;
|
|
|
- stackTrace: DebugProtocol.StackTraceArguments;
|
|
|
- stepBack: DebugProtocol.StepBackArguments;
|
|
|
- stepIn: DebugProtocol.StepInArguments;
|
|
|
- stepInTargets: DebugProtocol.StepInTargetsArguments;
|
|
|
- stepOut: DebugProtocol.StepOutArguments;
|
|
|
- terminate: DebugProtocol.TerminateArguments;
|
|
|
- terminateThreads: DebugProtocol.TerminateThreadsArguments;
|
|
|
- threads: {};
|
|
|
- updateCell: IUpdateCellArguments;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * Interface for all the debug response types.
|
|
|
- */
|
|
|
- export interface IDebugResponseTypes {
|
|
|
- attach: DebugProtocol.AttachResponse;
|
|
|
- completions: DebugProtocol.CompletionsResponse;
|
|
|
- configurationDone: DebugProtocol.ConfigurationDoneResponse;
|
|
|
- continue: DebugProtocol.ContinueResponse;
|
|
|
- disconnect: DebugProtocol.DisconnectResponse;
|
|
|
- evaluate: DebugProtocol.EvaluateResponse;
|
|
|
- exceptionInfo: DebugProtocol.ExceptionInfoResponse;
|
|
|
- goto: DebugProtocol.GotoResponse;
|
|
|
- gotoTargets: DebugProtocol.GotoTargetsResponse;
|
|
|
- initialize: DebugProtocol.InitializeResponse;
|
|
|
- launch: DebugProtocol.LaunchResponse;
|
|
|
- loadedSources: DebugProtocol.LoadedSourcesResponse;
|
|
|
- modules: DebugProtocol.ModulesResponse;
|
|
|
- next: DebugProtocol.NextResponse;
|
|
|
- pause: DebugProtocol.PauseResponse;
|
|
|
- restart: DebugProtocol.RestartResponse;
|
|
|
- restartFrame: DebugProtocol.RestartFrameResponse;
|
|
|
- reverseContinue: DebugProtocol.ReverseContinueResponse;
|
|
|
- scopes: DebugProtocol.ScopesResponse;
|
|
|
- setBreakpoints: DebugProtocol.SetBreakpointsResponse;
|
|
|
- setExceptionBreakpoints: DebugProtocol.SetExceptionBreakpointsResponse;
|
|
|
- setExpression: DebugProtocol.SetExpressionResponse;
|
|
|
- setFunctionBreakpoints: DebugProtocol.SetFunctionBreakpointsResponse;
|
|
|
- setVariable: DebugProtocol.SetVariableResponse;
|
|
|
- source: DebugProtocol.SourceResponse;
|
|
|
- stackTrace: DebugProtocol.StackTraceResponse;
|
|
|
- stepBack: DebugProtocol.StepBackResponse;
|
|
|
- stepIn: DebugProtocol.StepInResponse;
|
|
|
- stepInTargets: DebugProtocol.StepInTargetsResponse;
|
|
|
- stepOut: DebugProtocol.StepOutResponse;
|
|
|
- terminate: DebugProtocol.TerminateResponse;
|
|
|
- terminateThreads: DebugProtocol.TerminateThreadsResponse;
|
|
|
- threads: DebugProtocol.ThreadsResponse;
|
|
|
- updateCell: IUpdateCellResponse;
|
|
|
- variables: DebugProtocol.VariablesResponse;
|
|
|
- }
|
|
|
}
|