Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync state #272

Merged
merged 3 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions extensions/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@
"group": "PearAI"
},
{
"command": "pearai.focusCreatorView",
"command": "pearai.focusAgentView",
"category": "PearAI",
"title": "Focus PearAI Creator View",
"title": "Focus PearAI Agent View",
"group": "PearAI"
},
{
Expand All @@ -209,7 +209,7 @@
{
"command": "pearai.focusPearAIMem0View",
"category": "PearAI",
"title": "Focus PearAI Memory 0 View",
"title": "Focus PearAI Memory View",
"group": "PearAI"
},
{
Expand Down
30 changes: 28 additions & 2 deletions extensions/vscode/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,16 +386,37 @@ const commandsMap: (
});
console.log("FIRST PEARAI LAUNCH FLAG RESET");
},
"pearai.focusCreatorView": async () => {
vscode.commands.executeCommand("roo-cline.SidebarProvider.focus");
"pearai.focusAgentView": async () => {
try {
vscode.commands.executeCommand('workbench.action.switchToPearAIIntegrationIconBar', { view: 'agent' });
} catch (e) {
console.error("Failed to focus pearai-roo-cline sidebar:", e);
}
vscode.commands.executeCommand("pearai-roo-cline.SidebarProvider.focus");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider awaiting the executeCommand call inside try-catch so errors on promise rejection are caught.

Suggested change
vscode.commands.executeCommand("pearai-roo-cline.SidebarProvider.focus");
await vscode.commands.executeCommand("pearai-roo-cline.SidebarProvider.focus");


},
"pearai.focusPearAIMem0View": async () => {
try {
vscode.commands.executeCommand('workbench.action.switchToPearAIIntegrationIconBar', { view: 'memory' });
} catch (e) {
console.error("Failed to focus pearai-roo-cline sidebar:", e);
}
vscode.commands.executeCommand("pearai.mem0View.focus");
},
"pearai.focusPearAISearchView": async () => {
try {
vscode.commands.executeCommand('workbench.action.switchToPearAIIntegrationIconBar', { view: 'search' });
} catch (e) {
console.error("Failed to focus pearai-roo-cline sidebar:", e);
}
vscode.commands.executeCommand("pearai.searchView.focus");
},
"pearai.focusContinueInput": async () => {
try {
vscode.commands.executeCommand('workbench.action.switchToPearAIIntegrationIconBar', { view: 'chat' });
} catch (e) {
console.error("Failed to focus pearai-roo-cline sidebar:", e);
}
const fullScreenTab = getFullScreenTab();
if (!fullScreenTab) {
// focus sidebar
Expand All @@ -408,6 +429,11 @@ const commandsMap: (
await addHighlightedCodeToContext(sidebar.webviewProtocol);
},
"pearai.focusContinueInputWithoutClear": async () => {
try {
vscode.commands.executeCommand('workbench.action.switchToPearAIIntegrationIconBar', { view: 'chat' });
} catch (e) {
console.error("Failed to focus pearai-roo-cline sidebar:", e);
}
const fullScreenTab = getFullScreenTab();

const isContinueInputFocused = await sidebar.webviewProtocol.request(
Expand Down