Skip to content

Commit 2ed1954

Browse files
authored
Merge pull request #13 from trypear/sync-state
Sync state with app
2 parents cd89f32 + d6477e3 commit 2ed1954

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"pearai-roo-cline": [
6464
{
6565
"type": "webview",
66-
"id": "roo-cline.SidebarProvider",
66+
"id": "pearai-roo-cline.SidebarProvider",
6767
"name": ""
6868
}
6969
]
@@ -157,32 +157,32 @@
157157
{
158158
"command": "roo-cline.plusButtonClicked",
159159
"group": "navigation@1",
160-
"when": "view == roo-cline.SidebarProvider"
160+
"when": "view == pearai-roo-cline.SidebarProvider"
161161
},
162162
{
163163
"command": "roo-cline.promptsButtonClicked",
164164
"group": "navigation@2",
165-
"when": "view == roo-cline.SidebarProvider"
165+
"when": "view == pearai-roo-cline.SidebarProvider"
166166
},
167167
{
168168
"command": "roo-cline.mcpButtonClicked",
169169
"group": "navigation@3",
170-
"when": "view == roo-cline.SidebarProvider"
170+
"when": "view == pearai-roo-cline.SidebarProvider"
171171
},
172172
{
173173
"command": "roo-cline.historyButtonClicked",
174174
"group": "navigation@4",
175-
"when": "view == roo-cline.SidebarProvider"
175+
"when": "view == pearai-roo-cline.SidebarProvider"
176176
},
177177
{
178178
"command": "roo-cline.popoutButtonClicked",
179179
"group": "navigation@5",
180-
"when": "view == roo-cline.SidebarProvider"
180+
"when": "view == pearai-roo-cline.SidebarProvider"
181181
},
182182
{
183183
"command": "roo-cline.settingsButtonClicked",
184184
"group": "navigation@6",
185-
"when": "view == roo-cline.SidebarProvider"
185+
"when": "view == pearai-roo-cline.SidebarProvider"
186186
}
187187
]
188188
},

src/core/webview/ClineProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export const GlobalFileNames = {
141141
}
142142

143143
export class ClineProvider implements vscode.WebviewViewProvider {
144-
public static readonly sideBarId = "roo-cline.SidebarProvider" // used in package.json as the view's id. This value cannot be changed due to how vscode caches views based on their id, and updating the id would break existing instances of the extension.
144+
public static readonly sideBarId = "pearai-roo-cline.SidebarProvider" // used in package.json as the view's id. This value cannot be changed due to how vscode caches views based on their id, and updating the id would break existing instances of the extension.
145145
public static readonly tabPanelId = "roo-cline.TabPanelProvider"
146146
private static activeInstances: Set<ClineProvider> = new Set()
147147
private disposables: vscode.Disposable[] = []
@@ -204,7 +204,7 @@ export class ClineProvider implements vscode.WebviewViewProvider {
204204

205205
// If no visible provider, try to show the sidebar view
206206
if (!visibleProvider) {
207-
await vscode.commands.executeCommand("roo-cline.SidebarProvider.focus")
207+
await vscode.commands.executeCommand("pearai-roo-cline.SidebarProvider.focus")
208208
// Wait briefly for the view to become visible
209209
await delay(100)
210210
visibleProvider = ClineProvider.getVisibleInstance()

src/extension.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,14 @@ export function activate(context: vscode.ExtensionContext) {
274274

275275
context.subscriptions.push(
276276
vscode.commands.registerCommand("roo-cline.focus", async (...args: any[]) => {
277-
await vscode.commands.executeCommand("roo-cline.SidebarProvider.focus")
277+
try {
278+
await vscode.commands.executeCommand("workbench.action.switchToPearAIIntegrationIconBar", {
279+
view: "agent",
280+
})
281+
} catch (error) {
282+
// Silently handle any errors that might occur when switching to the integration bar
283+
}
284+
await vscode.commands.executeCommand("pearai-roo-cline.SidebarProvider.focus")
278285
}),
279286
)
280287

0 commit comments

Comments
 (0)