Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
37 changes: 37 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,43 @@
"group": "navigation@7",
"when": "view == roo-cline.SidebarProvider"
}
],
"editor/title": [
{
"command": "roo-cline.plusButtonClicked",
"group": "navigation@1",
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
},
{
"command": "roo-cline.promptsButtonClicked",
"group": "navigation@2",
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
},
{
"command": "roo-cline.mcpButtonClicked",
"group": "navigation@3",
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
},
{
"command": "roo-cline.historyButtonClicked",
"group": "navigation@4",
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
},
{
"command": "roo-cline.popoutButtonClicked",
"group": "navigation@5",
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
},
{
"command": "roo-cline.settingsButtonClicked",
"group": "navigation@6",
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
},
{
"command": "roo-cline.helpButtonClicked",
"group": "navigation@7",
"when": "activeWebviewPanelId == roo-cline.TabPanelProvider"
}
]
},
"configuration": {
Expand Down
39 changes: 32 additions & 7 deletions src/activate/registerCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,48 @@ const getCommandsMap = ({ context, outputChannel, provider }: RegisterCommandOpt
return {
"roo-cline.activationCompleted": () => {},
"roo-cline.plusButtonClicked": async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider adding try/catch blocks in these asynchronous command callbacks (e.g., in roo-cline.plusButtonClicked) to gracefully handle errors arising from provider methods. This will prevent unhandled promise rejections and improve overall extension stability.

await provider.removeClineFromStack()
await provider.postStateToWebview()
await provider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
const visibleProvider = ClineProvider.getVisibleInstance()
if (!visibleProvider) {
outputChannel.appendLine("Cannot find any visible Cline instances.")
return
}
await visibleProvider.removeClineFromStack()
await visibleProvider.postStateToWebview()
await visibleProvider.postMessageToWebview({ type: "action", action: "chatButtonClicked" })
},
"roo-cline.mcpButtonClicked": () => {
provider.postMessageToWebview({ type: "action", action: "mcpButtonClicked" })
const visibleProvider = ClineProvider.getVisibleInstance()
if (!visibleProvider) {
outputChannel.appendLine("Cannot find any visible Cline instances.")
return
}
visibleProvider.postMessageToWebview({ type: "action", action: "mcpButtonClicked" })
},
"roo-cline.promptsButtonClicked": () => {
provider.postMessageToWebview({ type: "action", action: "promptsButtonClicked" })
const visibleProvider = ClineProvider.getVisibleInstance()
if (!visibleProvider) {
outputChannel.appendLine("Cannot find any visible Cline instances.")
return
}
visibleProvider.postMessageToWebview({ type: "action", action: "promptsButtonClicked" })
},
"roo-cline.popoutButtonClicked": () => openClineInNewTab({ context, outputChannel }),
"roo-cline.openInNewTab": () => openClineInNewTab({ context, outputChannel }),
"roo-cline.settingsButtonClicked": () => {
provider.postMessageToWebview({ type: "action", action: "settingsButtonClicked" })
const visibleProvider = ClineProvider.getVisibleInstance()
if (!visibleProvider) {
outputChannel.appendLine("Cannot find any visible Cline instances.")
return
}
visibleProvider.postMessageToWebview({ type: "action", action: "settingsButtonClicked" })
},
"roo-cline.historyButtonClicked": () => {
provider.postMessageToWebview({ type: "action", action: "historyButtonClicked" })
const visibleProvider = ClineProvider.getVisibleInstance()
if (!visibleProvider) {
outputChannel.appendLine("Cannot find any visible Cline instances.")
return
}
visibleProvider.postMessageToWebview({ type: "action", action: "historyButtonClicked" })
},
"roo-cline.helpButtonClicked": () => {
vscode.env.openExternal(vscode.Uri.parse("https://docs.roocode.com"))
Expand Down