From 4498f92e973f40397ce13204c987be23233e4b2b Mon Sep 17 00:00:00 2001 From: Andre Weinand Date: Wed, 12 Jul 2017 01:11:53 +0200 Subject: [PATCH] add more debug API --- src/vs/vscode.d.ts | 52 +++++++++++++++++-- src/vs/vscode.proposed.d.ts | 51 ------------------ src/vs/workbench/api/node/extHost.api.impl.ts | 8 +-- 3 files changed, 52 insertions(+), 59 deletions(-) diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 2f717e4ddbf..7733a20491f 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -5352,6 +5352,11 @@ declare module 'vscode' { */ export interface DebugSession { + /** + * The unique ID of this debug session. + */ + readonly id: string; + /** * The debug session's type from the debug configuration. */ @@ -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; + 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. * @param configuration */ export function createDebugSession(configuration: DebugConfiguration): Thenable; + + /** + * 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; + + /** + * An [event](#Event) which fires when a custom DAP event is received from the debug session. + */ + export const onDidReceiveDebugSessionCustomEvent: Event; + + /** + * An [event](#Event) which fires when a debug session has terminated. + */ + export const onDidTerminateDebugSession: Event; } /** diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 9f210280fa4..6b3227a6cff 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -189,55 +189,4 @@ declare module 'vscode' { */ 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; - - /** - * An [event](#Event) which fires when a custom DAP event is received from the debug session. - */ - export const onDidReceiveDebugSessionCustomEvent: Event; - } - - export interface DebugSession { - - /** - * The debug session's ID. - */ - readonly id: string; - } - } diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 904e8946333..de0671d581b 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -473,12 +473,12 @@ export function createApiFactory( 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); - }), - onDidReceiveDebugSessionCustomEvent: proposedApiFunction(extension, (listener, thisArg?, disposables?) => { + }, + onDidReceiveDebugSessionCustomEvent(listener, thisArg?, disposables?) { return extHostDebugService.onDidReceiveDebugSessionCustomEvent(listener, thisArg, disposables); - }) + } }; -- GitLab