From 6e009e0537f3c58caffd3fc41cc367d8264ebbde Mon Sep 17 00:00:00 2001 From: Connor Peet Date: Tue, 7 May 2024 10:30:08 -0700 Subject: [PATCH] debug: finalize debugFocus API (#212190) Closes #63943 --- .../workbench/api/common/extHost.api.impl.ts | 4 -- .../common/extensionsApiProposals.ts | 1 - src/vscode-dts/vscode.d.ts | 57 ++++++++++++++++ .../vscode.proposed.debugFocus.d.ts | 66 ------------------- 4 files changed, 57 insertions(+), 71 deletions(-) delete mode 100644 src/vscode-dts/vscode.proposed.debugFocus.d.ts diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 297dacd2e4c..d0b5accb676 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -1244,9 +1244,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return extHostDebugService.breakpoints; }, get activeStackItem() { - if (!isProposedApiEnabled(extension, 'debugFocus')) { - return undefined; - } return extHostDebugService.activeStackItem; }, registerDebugVisualizationProvider(id, provider) { @@ -1273,7 +1270,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I return _asExtensionEvent(extHostDebugService.onDidChangeBreakpoints)(listener, thisArgs, disposables); }, onDidChangeActiveStackItem(listener, thisArg?, disposables?) { - checkProposedApiEnabled(extension, 'debugFocus'); return _asExtensionEvent(extHostDebugService.onDidChangeActiveStackItem)(listener, thisArg, disposables); }, registerDebugConfigurationProvider(debugType: string, provider: vscode.DebugConfigurationProvider, triggerKind?: vscode.DebugConfigurationProviderTriggerKind) { diff --git a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts index 2ee7867c7c5..ccc37fcf750 100644 --- a/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts +++ b/src/vs/workbench/services/extensions/common/extensionsApiProposals.ts @@ -50,7 +50,6 @@ export const allApiProposals = Object.freeze({ contribViewsWelcome: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.contribViewsWelcome.d.ts', createFileSystemWatcher: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts', customEditorMove: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.customEditorMove.d.ts', - debugFocus: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugFocus.d.ts', debugVisualization: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.debugVisualization.d.ts', defaultChatParticipant: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.defaultChatParticipant.d.ts', diffCommand: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.diffCommand.d.ts', diff --git a/src/vscode-dts/vscode.d.ts b/src/vscode-dts/vscode.d.ts index 41946ad4c0d..f30cfa4a4eb 100644 --- a/src/vscode-dts/vscode.d.ts +++ b/src/vscode-dts/vscode.d.ts @@ -16195,6 +16195,50 @@ declare module 'vscode' { Dynamic = 2 } + /** + * Represents a thread in a debug session. + */ + export class DebugThread { + /** + * Debug session for thread. + */ + readonly session: DebugSession; + + /** + * ID of the associated thread in the debug protocol. + */ + readonly threadId: number; + + /** + * @hidden + */ + private constructor(session: DebugSession, threadId: number); + } + + /** + * Represents a stack frame in a debug session. + */ + export class DebugStackFrame { + /** + * Debug session for thread. + */ + readonly session: DebugSession; + + /** + * ID of the associated thread in the debug protocol. + */ + readonly threadId: number; + /** + * ID of the stack frame in the debug protocol. + */ + readonly frameId: number; + + /** + * @hidden + */ + private constructor(session: DebugSession, threadId: number, frameId: number); + } + /** * Namespace for debug functionality. */ @@ -16245,6 +16289,19 @@ declare module 'vscode' { */ export const onDidChangeBreakpoints: Event; + /** + * The currently focused thread or stack frame, or `undefined` if no + * thread or stack is focused. A thread can be focused any time there is + * an active debug session, while a stack frame can only be focused when + * a session is paused and the call stack has been retrieved. + */ + export const activeStackItem: DebugThread | DebugStackFrame | undefined; + + /** + * An event which fires when the {@link debug.activeStackItem} has changed. + */ + export const onDidChangeActiveStackItem: Event; + /** * Register a {@link DebugConfigurationProvider debug configuration provider} for a specific debug type. * The optional {@link DebugConfigurationProviderTriggerKind triggerKind} can be used to specify when the `provideDebugConfigurations` method of the provider is triggered. diff --git a/src/vscode-dts/vscode.proposed.debugFocus.d.ts b/src/vscode-dts/vscode.proposed.debugFocus.d.ts deleted file mode 100644 index 636cb4745f4..00000000000 --- a/src/vscode-dts/vscode.proposed.debugFocus.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -declare module 'vscode' { - - // See https://github.com/microsoft/vscode/issues/63943 - - export class DebugThread { - /** - * Create a ThreadFocus - * @param session - * @param threadId - */ - constructor(session: DebugSession, threadId: number); - - /** - * Debug session for thread. - */ - readonly session: DebugSession; - - /** - * ID of the associated thread in the debug protocol. - */ - readonly threadId: number; - } - - export class DebugStackFrame { - /** - * Create a StackFrameFocus - * @param session - * @param threadId - * @param frameId - */ - constructor(session: DebugSession, threadId?: number, frameId?: number); - - /** - * Debug session for thread. - */ - readonly session: DebugSession; - - /** - * Id of the associated thread in the debug protocol. - */ - readonly threadId: number; - /** - * Id of the stack frame in the debug protocol. - */ - readonly frameId: number; - } - - - export namespace debug { - /** - * The currently focused thread or stack frame, or `undefined` if no - * thread or stack is focused. - */ - export const activeStackItem: DebugThread | DebugStackFrame | undefined; - - /** - * An event which fires when the {@link debug.activeStackItem} has changed. - */ - export const onDidChangeActiveStackItem: Event; - } -}