mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Add new/existing task for all three actions
This commit is contained in:
@@ -171,6 +171,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
context: vscode.ExtensionContext,
|
||||
command: string,
|
||||
promptType: keyof typeof ACTION_NAMES,
|
||||
inNewTask: boolean,
|
||||
inputPrompt?: string,
|
||||
inputPlaceholder?: string,
|
||||
) => {
|
||||
@@ -200,8 +201,23 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
)
|
||||
}
|
||||
|
||||
// Helper function to register both versions of a code action
|
||||
const registerCodeActionPair = (
|
||||
context: vscode.ExtensionContext,
|
||||
baseCommand: string,
|
||||
promptType: keyof typeof ACTION_NAMES,
|
||||
inputPrompt?: string,
|
||||
inputPlaceholder?: string,
|
||||
) => {
|
||||
// Register new task version
|
||||
registerCodeAction(context, baseCommand, promptType, true, inputPrompt, inputPlaceholder)
|
||||
|
||||
// Register current task version
|
||||
registerCodeAction(context, `${baseCommand}InCurrentTask`, promptType, false, inputPrompt, inputPlaceholder)
|
||||
}
|
||||
|
||||
// Register code action commands
|
||||
registerCodeAction(
|
||||
registerCodeActionPair(
|
||||
context,
|
||||
"roo-cline.explainCode",
|
||||
"EXPLAIN",
|
||||
@@ -209,7 +225,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
"E.g. How does the error handling work?",
|
||||
)
|
||||
|
||||
registerCodeAction(
|
||||
registerCodeActionPair(
|
||||
context,
|
||||
"roo-cline.fixCode",
|
||||
"FIX",
|
||||
@@ -217,15 +233,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
"E.g. Maintain backward compatibility",
|
||||
)
|
||||
|
||||
registerCodeAction(
|
||||
context,
|
||||
"roo-cline.fixCodeInCurrentTask",
|
||||
"FIX", // keep this for use the same prompt with FIX command
|
||||
"What would you like Roo to fix?",
|
||||
"E.g. Maintain backward compatibility",
|
||||
)
|
||||
|
||||
registerCodeAction(
|
||||
registerCodeActionPair(
|
||||
context,
|
||||
"roo-cline.improveCode",
|
||||
"IMPROVE",
|
||||
|
||||
Reference in New Issue
Block a user