diff --git a/src/vs/workbench/api/common/extHostEditorTabs.ts b/src/vs/workbench/api/common/extHostEditorTabs.ts index 5230e595d9b..992f4f04c76 100644 --- a/src/vs/workbench/api/common/extHostEditorTabs.ts +++ b/src/vs/workbench/api/common/extHostEditorTabs.ts @@ -34,6 +34,7 @@ export interface IEditorTabGroup { export interface IEditorTabGroups { all: IEditorTabGroup[]; + activeTabGroup: IEditorTabGroup | undefined; onDidChangeTabGroup: Event; } @@ -53,6 +54,7 @@ export class ExtHostEditorTabs implements IExtHostEditorTabs { private _tabGroups: IEditorTabGroups = { all: [], + activeTabGroup: undefined, onDidChangeTabGroup: this._onDidChangeTabGroup.event }; @@ -82,6 +84,11 @@ export class ExtHostEditorTabs implements IExtHostEditorTabs { activeTab, tabs })); + // If the currrent group is active, set the active group to be that group. + // We must use the same object so we pull from the array to allow for reference equality + if (group.isActive) { + this._tabGroups.activeTabGroup = this._tabGroups.all[this._tabGroups.all.length - 1]; + } } this._onDidChangeTabGroup.fire(); } diff --git a/src/vscode-dts/vscode.proposed.tabs.d.ts b/src/vscode-dts/vscode.proposed.tabs.d.ts index c4298a97a11..5dc164b6cc7 100644 --- a/src/vscode-dts/vscode.proposed.tabs.d.ts +++ b/src/vscode-dts/vscode.proposed.tabs.d.ts @@ -101,6 +101,11 @@ declare module 'vscode' { */ readonly all: TabGroup[]; + /** + * The currently active group + */ + readonly activeTabGroup: TabGroup | undefined; + /** * An {@link Event} which fires when a group changes. */