diff --git a/CHANGELOG.md b/CHANGELOG.md
index d1fa54a24e354..bbc251ee0e241 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -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
+
[Breaking Changes:](#breaking_changes_not_yet_released)
- [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).
diff --git a/packages/plugin-ext/src/plugin/plugin-context.ts b/packages/plugin-ext/src/plugin/plugin-context.ts
index 4aa0d22c6cb15..c37330cbf90de 100644
--- a/packages/plugin-ext/src/plugin/plugin-context.ts
+++ b/packages/plugin-ext/src/plugin/plugin-context.ts
@@ -124,6 +124,8 @@ import {
Breakpoint,
SourceBreakpoint,
FunctionBreakpoint,
+ DebugStackFrame,
+ DebugThread,
FoldingRange,
FoldingRangeKind,
SelectionRange,
@@ -1090,6 +1092,14 @@ export function createAPIFactory(
get onDidChangeBreakpoints(): theia.Event {
return debugExt.onDidChangeBreakpoints;
},
+ /** @stubbed */
+ get activeStackItem(): DebugThread | DebugStackFrame | undefined {
+ return undefined;
+ },
+ /** @stubbed */
+ get onDidChangeActiveStackItem(): theia.Event {
+ return Event.None;
+ },
registerDebugAdapterDescriptorFactory(debugType: string, factory: theia.DebugAdapterDescriptorFactory): Disposable {
return debugExt.registerDebugAdapterDescriptorFactory(debugType, factory);
},
@@ -1372,6 +1382,8 @@ export function createAPIFactory(
Breakpoint,
SourceBreakpoint,
FunctionBreakpoint,
+ DebugStackFrame,
+ DebugThread,
Color,
ColorInformation,
ColorPresentation,
diff --git a/packages/plugin-ext/src/plugin/types-impl.ts b/packages/plugin-ext/src/plugin/types-impl.ts
index 4209dd20d62d8..4e5bbd16133c3 100644
--- a/packages/plugin-ext/src/plugin/types-impl.ts
+++ b/packages/plugin-ext/src/plugin/types-impl.ts
@@ -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;
diff --git a/packages/plugin/src/theia.d.ts b/packages/plugin/src/theia.d.ts
index 07913feef680d..a3f00380cbe8b 100644
--- a/packages/plugin/src/theia.d.ts
+++ b/packages/plugin/src/theia.d.ts
@@ -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.
*/
@@ -12497,6 +12541,21 @@ export module '@theia/plugin' {
*/
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.
+ * @stubbed
+ */
+ export const activeStackItem: DebugThread | DebugStackFrame | undefined;
+
+ /**
+ * An event which fires when the {@link debug.activeStackItem} has changed.
+ * @stubbed
+ */
+ export const onDidChangeActiveStackItem: Event;
+
/**
* 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.