-
Notifications
You must be signed in to change notification settings - Fork 28k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debug API for call stack selection changes (63943) (#179132)
* feat: Initial pass at Debug Focus, listener for thread or stack frame selection (#63943) Add debug.onDidChangeDebugFocus. May provide ids for session, thread, and stackFrame, as appropriate. Fixes: #63943 api should provide thread/stack frame id (paraphrasing) * chore: small comment tweaks in proposal * fix: bad copy/paste in proposed. moved types out of 'debug' namespace * fix: separate 'debugFocus' into thread and stackFrame specific listeners, and create separate contexts for each * fix: Revert prev change, switch to single api with union type This reverts commit c308bc3. * fix: rename accessor from 'focus' to 'stackFrameFocus' * fix: review comments; remove unused type, imrpove comments * fixL review comments, type change: sessionID property cannot be undefined * Remove comments --------- Co-authored-by: Rob Lourens <roblourens@gmail.com>
- Loading branch information
1 parent
d3d397c
commit 2de3b04
Showing
8 changed files
with
160 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* 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 interface ThreadFocus { | ||
kind: 'thread'; | ||
|
||
/** | ||
* Debug session for thread. | ||
*/ | ||
readonly session: DebugSession; | ||
|
||
/** | ||
* Id of the associated thread (DAP id). May be undefined if thread has become unselected. | ||
*/ | ||
readonly threadId: number | undefined; | ||
} | ||
|
||
export interface StackFrameFocus { | ||
kind: 'stackFrame'; | ||
|
||
/** | ||
* Debug session for thread. | ||
*/ | ||
readonly session: DebugSession; | ||
|
||
/** | ||
* Id of the associated thread (DAP id). May be undefined if a frame is unselected. | ||
*/ | ||
readonly threadId: number | undefined; | ||
/** | ||
* Id of the stack frame (DAP id). May be undefined if a frame is unselected. | ||
*/ | ||
readonly frameId: number | undefined; | ||
} | ||
|
||
|
||
export namespace debug { | ||
/** | ||
* The currently focused thread or stack frame id, or `undefined` if this has not been set. (e.g. not in debug mode). | ||
*/ | ||
export let stackFrameFocus: ThreadFocus | StackFrameFocus | undefined; | ||
|
||
/** | ||
* An {@link Event} which fires when the {@link debug.stackFrameFocus} changes. Provides a sessionId. threadId is not undefined | ||
* when a thread of frame has gained focus. frameId is defined when a stackFrame has gained focus. | ||
*/ | ||
export const onDidChangeStackFrameFocus: Event<ThreadFocus | StackFrameFocus | undefined>; | ||
} | ||
} |