diff --git a/src/vs/workbench/api/common/extHostEditorTabs.ts b/src/vs/workbench/api/common/extHostEditorTabs.ts index 292cd429c3f..6fe404878bb 100644 --- a/src/vs/workbench/api/common/extHostEditorTabs.ts +++ b/src/vs/workbench/api/common/extHostEditorTabs.ts @@ -321,26 +321,26 @@ export class ExtHostEditorTabs implements IExtHostEditorTabs { // Construct the tab change event based on the operation switch (operation.kind) { case TabModelOperationKind.TAB_OPEN: - this._onDidChangeTabs.fire({ - added: [tab.apiObject], - removed: [], + this._onDidChangeTabs.fire(Object.freeze({ + opened: [tab.apiObject], + closed: [], changed: [] - }); + })); return; case TabModelOperationKind.TAB_CLOSE: - this._onDidChangeTabs.fire({ - added: [], - removed: [tab.apiObject], + this._onDidChangeTabs.fire(Object.freeze({ + opened: [], + closed: [tab.apiObject], changed: [] - }); + })); return; case TabModelOperationKind.TAB_MOVE: case TabModelOperationKind.TAB_UPDATE: - this._onDidChangeTabs.fire({ - added: [], - removed: [], + this._onDidChangeTabs.fire(Object.freeze({ + opened: [], + closed: [], changed: [tab.apiObject] - }); + })); return; } } diff --git a/src/vscode-dts/vscode.proposed.tabs.d.ts b/src/vscode-dts/vscode.proposed.tabs.d.ts index 381506507b6..1029de92ac1 100644 --- a/src/vscode-dts/vscode.proposed.tabs.d.ts +++ b/src/vscode-dts/vscode.proposed.tabs.d.ts @@ -154,10 +154,18 @@ declare module 'vscode' { } export interface TabChangeEvent { - // TODO@API consider: opened - readonly added: readonly Tab[]; - // TODO@API consider: closed (aligns with TabGroups.close(...)) - readonly removed: readonly Tab[]; + /** + * The tabs that have been opened + */ + readonly opened: readonly Tab[]; + /** + * The tabs that have been closed + */ + readonly closed: readonly Tab[]; + /** + * Tabs that have changed, e.g have changed + * their {@link Tab.isActive active} state. + */ readonly changed: readonly Tab[]; }