MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / TabGroupsAPI

Class TabGroupsAPI

packages/vscode-shim/src/api/TabGroupsAPI.ts:36–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 * Tab groups API mock for CLI mode
35 */
36export class TabGroupsAPI {
37 private _onDidChangeTabs = new EventEmitter<void>()
38 private _tabGroups: TabGroup[] = []
39
40 get all(): TabGroup[] {
41 return this._tabGroups
42 }
43
44 onDidChangeTabs(listener: () => void): Disposable {
45 return this._onDidChangeTabs.event(listener)
46 }
47
48 async close(tab: Tab): Promise<boolean> {
49 // Find and remove the tab from all groups
50 for (const group of this._tabGroups) {
51 const index = group.tabs.indexOf(tab)
52 if (index !== -1) {
53 group.tabs.splice(index, 1)
54 this._onDidChangeTabs.fire()
55 return true
56 }
57 }
58 return false
59 }
60
61 // Internal method to simulate tab changes for CLI
62 _simulateTabChange(): void {
63 this._onDidChangeTabs.fire()
64 }
65
66 dispose(): void {
67 this._onDidChangeTabs.dispose()
68 }
69}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected