mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Remove terminal actions
This commit is contained in:
parent
93a394dd93
commit
75dcc2ffcf
4 changed files with 2 additions and 137 deletions
47
package.json
47
package.json
|
|
@ -128,31 +128,6 @@
|
|||
"command": "roo-cline.addToContext",
|
||||
"title": "Roo Code: Add To Context",
|
||||
"category": "Roo Code"
|
||||
},
|
||||
{
|
||||
"command": "roo-cline.terminalAddToContext",
|
||||
"title": "Roo Code: Add Terminal Content to Context",
|
||||
"category": "Terminal"
|
||||
},
|
||||
{
|
||||
"command": "roo-cline.terminalFixCommand",
|
||||
"title": "Roo Code: Fix This Command",
|
||||
"category": "Terminal"
|
||||
},
|
||||
{
|
||||
"command": "roo-cline.terminalExplainCommand",
|
||||
"title": "Roo Code: Explain This Command",
|
||||
"category": "Terminal"
|
||||
},
|
||||
{
|
||||
"command": "roo-cline.terminalFixCommandInCurrentTask",
|
||||
"title": "Roo Code: Fix This Command (Current Task)",
|
||||
"category": "Terminal"
|
||||
},
|
||||
{
|
||||
"command": "roo-cline.terminalExplainCommandInCurrentTask",
|
||||
"title": "Roo Code: Explain This Command (Current Task)",
|
||||
"category": "Terminal"
|
||||
}
|
||||
],
|
||||
"menus": {
|
||||
|
|
@ -178,28 +153,6 @@
|
|||
"group": "Roo Code@4"
|
||||
}
|
||||
],
|
||||
"terminal/context": [
|
||||
{
|
||||
"command": "roo-cline.terminalAddToContext",
|
||||
"group": "Roo Code@1"
|
||||
},
|
||||
{
|
||||
"command": "roo-cline.terminalFixCommand",
|
||||
"group": "Roo Code@2"
|
||||
},
|
||||
{
|
||||
"command": "roo-cline.terminalExplainCommand",
|
||||
"group": "Roo Code@3"
|
||||
},
|
||||
{
|
||||
"command": "roo-cline.terminalFixCommandInCurrentTask",
|
||||
"group": "Roo Code@5"
|
||||
},
|
||||
{
|
||||
"command": "roo-cline.terminalExplainCommandInCurrentTask",
|
||||
"group": "Roo Code@6"
|
||||
}
|
||||
],
|
||||
"view/title": [
|
||||
{
|
||||
"command": "roo-cline.plusButtonClicked",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
export { handleUri } from "./handleUri"
|
||||
export { registerCommands } from "./registerCommands"
|
||||
export { registerCodeActions } from "./registerCodeActions"
|
||||
export { registerTerminalActions } from "./registerTerminalActions"
|
||||
|
|
|
|||
|
|
@ -1,81 +0,0 @@
|
|||
import * as vscode from "vscode"
|
||||
import { ClineProvider } from "../core/webview/ClineProvider"
|
||||
import { TerminalManager } from "../integrations/terminal/TerminalManager"
|
||||
|
||||
const TERMINAL_COMMAND_IDS = {
|
||||
ADD_TO_CONTEXT: "roo-cline.terminalAddToContext",
|
||||
FIX: "roo-cline.terminalFixCommand",
|
||||
FIX_IN_CURRENT_TASK: "roo-cline.terminalFixCommandInCurrentTask",
|
||||
EXPLAIN: "roo-cline.terminalExplainCommand",
|
||||
EXPLAIN_IN_CURRENT_TASK: "roo-cline.terminalExplainCommandInCurrentTask",
|
||||
} as const
|
||||
|
||||
export const registerTerminalActions = (context: vscode.ExtensionContext) => {
|
||||
const terminalManager = new TerminalManager()
|
||||
|
||||
registerTerminalAction(context, terminalManager, TERMINAL_COMMAND_IDS.ADD_TO_CONTEXT, "TERMINAL_ADD_TO_CONTEXT")
|
||||
|
||||
registerTerminalActionPair(
|
||||
context,
|
||||
terminalManager,
|
||||
TERMINAL_COMMAND_IDS.FIX,
|
||||
"TERMINAL_FIX",
|
||||
"What would you like Roo to fix?",
|
||||
)
|
||||
|
||||
registerTerminalActionPair(
|
||||
context,
|
||||
terminalManager,
|
||||
TERMINAL_COMMAND_IDS.EXPLAIN,
|
||||
"TERMINAL_EXPLAIN",
|
||||
"What would you like Roo to explain?",
|
||||
)
|
||||
}
|
||||
|
||||
const registerTerminalAction = (
|
||||
context: vscode.ExtensionContext,
|
||||
terminalManager: TerminalManager,
|
||||
command: string,
|
||||
promptType: "TERMINAL_ADD_TO_CONTEXT" | "TERMINAL_FIX" | "TERMINAL_EXPLAIN",
|
||||
inputPrompt?: string,
|
||||
) => {
|
||||
context.subscriptions.push(
|
||||
vscode.commands.registerCommand(command, async (args: any) => {
|
||||
let content = args.selection
|
||||
if (!content || content === "") {
|
||||
content = await terminalManager.getTerminalContents(promptType === "TERMINAL_ADD_TO_CONTEXT" ? -1 : 1)
|
||||
}
|
||||
|
||||
if (!content) {
|
||||
vscode.window.showWarningMessage("No terminal content selected")
|
||||
return
|
||||
}
|
||||
|
||||
const params: Record<string, any> = {
|
||||
terminalContent: content,
|
||||
}
|
||||
|
||||
if (inputPrompt) {
|
||||
params.userInput =
|
||||
(await vscode.window.showInputBox({
|
||||
prompt: inputPrompt,
|
||||
})) ?? ""
|
||||
}
|
||||
|
||||
await ClineProvider.handleTerminalAction(command, promptType, params)
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
const registerTerminalActionPair = (
|
||||
context: vscode.ExtensionContext,
|
||||
terminalManager: TerminalManager,
|
||||
baseCommand: string,
|
||||
promptType: "TERMINAL_ADD_TO_CONTEXT" | "TERMINAL_FIX" | "TERMINAL_EXPLAIN",
|
||||
inputPrompt?: string,
|
||||
) => {
|
||||
// Register new task version
|
||||
registerTerminalAction(context, terminalManager, baseCommand, promptType, inputPrompt)
|
||||
// Register current task version
|
||||
registerTerminalAction(context, terminalManager, `${baseCommand}InCurrentTask`, promptType, inputPrompt)
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import { createClineAPI } from "./exports"
|
|||
import "./utils/path" // Necessary to have access to String.prototype.toPosix.
|
||||
import { CodeActionProvider } from "./core/CodeActionProvider"
|
||||
import { DIFF_VIEW_URI_SCHEME } from "./integrations/editor/DiffViewProvider"
|
||||
import { handleUri, registerCommands, registerCodeActions, registerTerminalActions } from "./activate"
|
||||
import { handleUri, registerCommands, registerCodeActions } from "./activate"
|
||||
import { McpServerManager } from "./services/mcp/McpServerManager"
|
||||
|
||||
/**
|
||||
|
|
@ -82,16 +82,10 @@ export function activate(context: vscode.ExtensionContext) {
|
|||
|
||||
registerCodeActions(context)
|
||||
|
||||
/**
|
||||
* Temporary disabled until we have a better way to share the terminal
|
||||
* manager.
|
||||
*/
|
||||
// registerTerminalActions(context)
|
||||
|
||||
return createClineAPI(outputChannel, sidebarProvider)
|
||||
}
|
||||
|
||||
// This method is called when your extension is deactivated
|
||||
// This method is called when your extension is deactivated.
|
||||
export async function deactivate() {
|
||||
outputChannel.appendLine("Roo-Code extension deactivated")
|
||||
// Clean up MCP server manager
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue