mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
some tweaks for inline debug adaper API; see #85544
This commit is contained in:
parent
a5ce0f26cd
commit
665b576260
|
@ -2824,14 +2824,12 @@ export class ProtocolServer implements vscode.DebugAdapter {
|
|||
private _sequence: number = 1;
|
||||
private _pendingRequests = new Map<number, (response: DebugProtocol.Response) => void>();
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
public handleMessage(message: DebugProtocol.ProtocolMessage): void {
|
||||
this.dispatch(message);
|
||||
}
|
||||
|
||||
public stop(): void {
|
||||
public dispose() {
|
||||
}
|
||||
|
||||
public sendEvent(event: DebugProtocol.Event): void {
|
||||
|
|
17
src/vs/vscode.proposed.d.ts
vendored
17
src/vs/vscode.proposed.d.ts
vendored
|
@ -582,7 +582,7 @@ declare module 'vscode' {
|
|||
|
||||
//#endregion
|
||||
|
||||
//#region André: debug
|
||||
//#region André: debug API for inline debug adapters https://github.com/microsoft/vscode/issues/85544
|
||||
|
||||
/**
|
||||
* A DebugProtocolMessage is an opaque stand-in type for the [ProtocolMessage](https://microsoft.github.io/debug-adapter-protocol/specification#Base_Protocol_ProtocolMessage) type defined in the Debug Adapter Protocol.
|
||||
|
@ -592,13 +592,22 @@ declare module 'vscode' {
|
|||
}
|
||||
|
||||
/**
|
||||
* A debug adapter that implements the Debug Adapter Protocol can be registered with VS Code if it implements this interface.
|
||||
* A debug adapter that implements the Debug Adapter Protocol can be registered with VS Code if it implements the DebugAdapter interface.
|
||||
*/
|
||||
export interface DebugAdapter {
|
||||
export interface DebugAdapter extends Disposable {
|
||||
|
||||
/**
|
||||
* An event which fires when the debug adapter sends a Debug Adapter Protocol message to VS Code.
|
||||
* Messages can be requests, responses, or events.
|
||||
*/
|
||||
readonly onSendMessage: Event<DebugProtocolMessage>;
|
||||
readonly onError: Event<Error>;
|
||||
|
||||
/**
|
||||
* Handle a Debug Adapter Protocol message.
|
||||
* Messages can be requests, responses, or events.
|
||||
* Results or errors are returned via onSendMessage events.
|
||||
* @param message A Debug Adapter Protocol message
|
||||
*/
|
||||
handleMessage(message: DebugProtocolMessage): void;
|
||||
}
|
||||
|
||||
|
|
|
@ -1054,12 +1054,6 @@ class DirectDebugAdapter extends AbstractDebugAdapter {
|
|||
this.acceptMessage(message);
|
||||
});
|
||||
}
|
||||
|
||||
if (this.implementation.onError) {
|
||||
implementation.onError((error: Error) => {
|
||||
this._onError.fire(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
startSession(): Promise<void> {
|
||||
|
@ -1073,6 +1067,9 @@ class DirectDebugAdapter extends AbstractDebugAdapter {
|
|||
}
|
||||
|
||||
stopSession(): Promise<void> {
|
||||
if (this.implementation.dispose) {
|
||||
this.implementation.dispose();
|
||||
}
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -547,10 +547,8 @@ export interface IDebugAdapterServer {
|
|||
readonly host?: string;
|
||||
}
|
||||
|
||||
export interface IDebugAdapterInlineImpl {
|
||||
export interface IDebugAdapterInlineImpl extends IDisposable {
|
||||
readonly onSendMessage: Event<DebugProtocol.Message>;
|
||||
readonly onError: Event<Error>;
|
||||
|
||||
handleMessage(message: DebugProtocol.Message): void;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue