debug: finalize debugFocus API (#212190)

Closes #63943
This commit is contained in:
Connor Peet
2024-05-07 19:30:08 +02:00
committed by GitHub
parent c4653faeb1
commit 6e009e0537
4 changed files with 57 additions and 71 deletions
@@ -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) {
@@ -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',
+57
View File
@@ -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<BreakpointsChangeEvent>;
/**
* 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<DebugThread | DebugStackFrame | undefined>;
/**
* 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.
-66
View File
@@ -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<DebugThread | DebugStackFrame | undefined>;
}
}