Skip to content

Commit

Permalink
[vscode] Stub DebugThread and DebugStackFrame (#13847)
Browse files Browse the repository at this point in the history
fixes #13758

contributed on behalf of STMicroelectronics

Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
  • Loading branch information
rschnekenbu authored Jun 27, 2024
1 parent f1420d1 commit 63c0684
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
- [plugin] Avoid pollution of all toolbars by actions contributed by tree views in extensions [#13768](https://github.com/eclipse-theia/theia/pull/13768) - contributed on behalf of STMicroelectronics
- [debug] stub activeStackItem and related change event in debug namespace [#13847](https://github.com/eclipse-theia/theia/pull/13847) - contributed on behalf of STMicroelectronics
<a name="breaking_changes_not_yet_released">[Breaking Changes:](#breaking_changes_not_yet_released)</a>
- [filesystem] Adjusted the "Save As" mechanism. It now assumes that `Saveable.getSnapshot()` returns a full snapshot of the editor model [#13689](https://github.com/eclipse-theia/theia/pull/13689).
Expand Down
12 changes: 12 additions & 0 deletions packages/plugin-ext/src/plugin/plugin-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ import {
Breakpoint,
SourceBreakpoint,
FunctionBreakpoint,
DebugStackFrame,
DebugThread,
FoldingRange,
FoldingRangeKind,
SelectionRange,
Expand Down Expand Up @@ -1090,6 +1092,14 @@ export function createAPIFactory(
get onDidChangeBreakpoints(): theia.Event<theia.BreakpointsChangeEvent> {
return debugExt.onDidChangeBreakpoints;
},
/** @stubbed */
get activeStackItem(): DebugThread | DebugStackFrame | undefined {
return undefined;
},
/** @stubbed */
get onDidChangeActiveStackItem(): theia.Event<DebugThread | DebugStackFrame | undefined> {
return Event.None;
},
registerDebugAdapterDescriptorFactory(debugType: string, factory: theia.DebugAdapterDescriptorFactory): Disposable {
return debugExt.registerDebugAdapterDescriptorFactory(debugType, factory);
},
Expand Down Expand Up @@ -1372,6 +1382,8 @@ export function createAPIFactory(
Breakpoint,
SourceBreakpoint,
FunctionBreakpoint,
DebugStackFrame,
DebugThread,
Color,
ColorInformation,
ColorPresentation,
Expand Down
8 changes: 8 additions & 0 deletions packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3028,6 +3028,14 @@ export class FunctionBreakpoint extends Breakpoint {
}
}

export class DebugThread {
private constructor(readonly session: theia.DebugSession, readonly threadId: number) { }
}

export class DebugStackFrame {
private constructor(readonly session: theia.DebugSession, readonly threadId: number, readonly frameId: number) { }
}

@es5ClassCompat
export class Color {
readonly red: number;
Expand Down
59 changes: 59 additions & 0 deletions packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12448,6 +12448,50 @@ export module '@theia/plugin' {
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.
*/
Expand Down Expand Up @@ -12497,6 +12541,21 @@ export module '@theia/plugin' {
*/
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.
* @stubbed
*/
export const activeStackItem: DebugThread | DebugStackFrame | undefined;

/**
* An event which fires when the {@link debug.activeStackItem} has changed.
* @stubbed
*/
export const onDidChangeActiveStackItem: Event<DebugThread | DebugStackFrame | undefined>;

/**
* Register a {@link DebugAdapterDescriptorFactory debug adapter descriptor factory} for a specific debug type.
* An extension is only allowed to register a DebugAdapterDescriptorFactory for the debug type(s) defined by the extension. Otherwise an error is thrown.
Expand Down

0 comments on commit 63c0684

Please sign in to comment.