提交 4498f92e 编写于 作者: A Andre Weinand

add more debug API

上级 883ed445
...@@ -5352,6 +5352,11 @@ declare module 'vscode' { ...@@ -5352,6 +5352,11 @@ declare module 'vscode' {
*/ */
export interface DebugSession { export interface DebugSession {
/**
* The unique ID of this debug session.
*/
readonly id: string;
/** /**
* The debug session's type from the debug configuration. * The debug session's type from the debug configuration.
*/ */
...@@ -5369,20 +5374,59 @@ declare module 'vscode' { ...@@ -5369,20 +5374,59 @@ declare module 'vscode' {
} }
/** /**
* Namespace for dealing with debug sessions. * A custom Debug Adapter Protocol event received from a [debug session](#DebugSession).
*/ */
export namespace debug { export interface DebugSessionCustomEvent {
/**
* The [debug session](#DebugSession) for which the custom event was received.
*/
session: DebugSession;
/** /**
* An [event](#Event) which fires when a debug session has terminated. * Type of event.
*/ */
export const onDidTerminateDebugSession: Event<DebugSession>; event: string;
/**
* Event specific information.
*/
body?: any;
}
/**
* Namespace for dealing with debug sessions.
*/
export namespace debug {
/** /**
* Create a new debug session based on the given configuration. * Create a new debug session based on the given configuration.
* @param configuration * @param configuration
*/ */
export function createDebugSession(configuration: DebugConfiguration): Thenable<DebugSession>; export function createDebugSession(configuration: DebugConfiguration): Thenable<DebugSession>;
/**
* The currently active debug session or `undefined`. The active debug session is the one
* represented by the debug action floating window or the one currently shown in the drop down menu of the debug action floating window.
* If no debug session is active, the value is `undefined`.
*/
export let activeDebugSession: DebugSession | undefined;
/**
* An [event](#Event) which fires when the [active debug session](#debug.activeDebugSession)
* has changed. *Note* that the event also fires when the active debug session changes
* to `undefined`.
*/
export const onDidChangeActiveDebugSession: Event<DebugSession | undefined>;
/**
* An [event](#Event) which fires when a custom DAP event is received from the debug session.
*/
export const onDidReceiveDebugSessionCustomEvent: Event<DebugSessionCustomEvent>;
/**
* An [event](#Event) which fires when a debug session has terminated.
*/
export const onDidTerminateDebugSession: Event<DebugSession>;
} }
/** /**
......
...@@ -189,55 +189,4 @@ declare module 'vscode' { ...@@ -189,55 +189,4 @@ declare module 'vscode' {
*/ */
onData(callback: (data: string) => any): void; onData(callback: (data: string) => any): void;
} }
/**
* A custom Debug Adapter Protocol event received from a [debug session](#DebugSession).
*/
export interface DebugSessionCustomEvent {
/**
* The [debug session](#DebugSession) for which the custom event was received.
*/
session: DebugSession;
/**
* Type of event.
*/
event: string;
/**
* Event specific information.
*/
body?: any;
}
export namespace debug {
/**
* The currently active debug session or `undefined`. The active debug session is the one
* represented by the debug action floating window or the one currently shown in the drop down menu of the debug action floating window.
* If no debug session is active, the value is `undefined`.
*/
export let activeDebugSession: DebugSession | undefined;
/**
* An [event](#Event) which fires when the [active debug session](#debug.activeDebugSession)
* has changed. *Note* that the event also fires when the active debug session changes
* to `undefined`.
*/
export const onDidChangeActiveDebugSession: Event<DebugSession | undefined>;
/**
* An [event](#Event) which fires when a custom DAP event is received from the debug session.
*/
export const onDidReceiveDebugSessionCustomEvent: Event<DebugSessionCustomEvent>;
}
export interface DebugSession {
/**
* The debug session's ID.
*/
readonly id: string;
}
} }
...@@ -473,12 +473,12 @@ export function createApiFactory( ...@@ -473,12 +473,12 @@ export function createApiFactory(
onDidTerminateDebugSession(listener, thisArg?, disposables?) { onDidTerminateDebugSession(listener, thisArg?, disposables?) {
return extHostDebugService.onDidTerminateDebugSession(listener, thisArg, disposables); return extHostDebugService.onDidTerminateDebugSession(listener, thisArg, disposables);
}, },
onDidChangeActiveDebugSession: proposedApiFunction(extension, (listener, thisArg?, disposables?) => { onDidChangeActiveDebugSession(listener, thisArg?, disposables?) {
return extHostDebugService.onDidChangeActiveDebugSession(listener, thisArg, disposables); return extHostDebugService.onDidChangeActiveDebugSession(listener, thisArg, disposables);
}), },
onDidReceiveDebugSessionCustomEvent: proposedApiFunction(extension, (listener, thisArg?, disposables?) => { onDidReceiveDebugSessionCustomEvent(listener, thisArg?, disposables?) {
return extHostDebugService.onDidReceiveDebugSessionCustomEvent(listener, thisArg, disposables); return extHostDebugService.onDidReceiveDebugSessionCustomEvent(listener, thisArg, disposables);
}) }
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册