mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
parent
2985172c61
commit
83ba22a44c
1 changed files with 24 additions and 10 deletions
|
|
@ -60,21 +60,35 @@ class WorkspaceTracker {
|
|||
|
||||
this.disposables.push(watcher)
|
||||
|
||||
this.disposables.push(vscode.window.tabGroups.onDidChangeTabs(() => this.workspaceDidReset()))
|
||||
// Listen for tab changes and call workspaceDidUpdate directly
|
||||
this.disposables.push(
|
||||
vscode.window.tabGroups.onDidChangeTabs(() => {
|
||||
// Reset if workspace path has changed
|
||||
if (this.prevWorkSpacePath !== this.cwd) {
|
||||
this.workspaceDidReset()
|
||||
} else {
|
||||
// Otherwise just update
|
||||
this.workspaceDidUpdate()
|
||||
}
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
private getOpenedTabsInfo() {
|
||||
return vscode.window.tabGroups.all.flatMap((group) =>
|
||||
group.tabs
|
||||
.filter((tab) => tab.input instanceof vscode.TabInputText)
|
||||
.map((tab) => {
|
||||
const path = (tab.input as vscode.TabInputText).uri.fsPath
|
||||
return {
|
||||
return vscode.window.tabGroups.all.reduce(
|
||||
(acc, group) => {
|
||||
const groupTabs = group.tabs
|
||||
.filter((tab) => tab.input instanceof vscode.TabInputText)
|
||||
.map((tab) => ({
|
||||
label: tab.label,
|
||||
isActive: tab.isActive,
|
||||
path: toRelativePath(path, this.cwd || ""),
|
||||
}
|
||||
}),
|
||||
path: toRelativePath((tab.input as vscode.TabInputText).uri.fsPath, this.cwd || ""),
|
||||
}))
|
||||
|
||||
groupTabs.forEach((tab) => (tab.isActive ? acc.unshift(tab) : acc.push(tab)))
|
||||
return acc
|
||||
},
|
||||
[] as Array<{ label: string; isActive: boolean; path: string }>,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue