From 3f93b5e7738c8c5066ef9a6c9caa573e81d7f7ab Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Mon, 21 Apr 2025 22:25:24 -0400 Subject: [PATCH 1/2] Allow replacing with an empty string --- src/core/tools/searchAndReplaceTool.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/tools/searchAndReplaceTool.ts b/src/core/tools/searchAndReplaceTool.ts index f371901e5fa..7a503b5f1ee 100644 --- a/src/core/tools/searchAndReplaceTool.ts +++ b/src/core/tools/searchAndReplaceTool.ts @@ -41,7 +41,7 @@ async function validateParams( return false } - if (!replace) { + if (replace === undefined) { cline.consecutiveMistakeCount++ cline.recordToolError("search_and_replace") pushToolResult(await cline.sayAndCreateMissingParamError("search_and_replace", "replace")) From 5c6018a8b9addc60820d0770de9b14ed2aee37c2 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Mon, 21 Apr 2025 22:38:18 -0400 Subject: [PATCH 2/2] Visual cleanup --- webview-ui/src/components/chat/ChatRow.tsx | 26 ++------------------- webview-ui/src/i18n/locales/de/chat.json | 2 +- webview-ui/src/i18n/locales/en/chat.json | 2 +- webview-ui/src/i18n/locales/ja/chat.json | 2 +- webview-ui/src/i18n/locales/zh-CN/chat.json | 2 +- webview-ui/src/i18n/locales/zh-TW/chat.json | 2 +- 6 files changed, 7 insertions(+), 29 deletions(-) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 486183c1505..8c09b101b15 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -323,36 +323,14 @@ export const ChatRowContent = ({ case "searchAndReplace": return ( <> -
+
{toolIcon("replace")} - + {message.type === "ask" ? t("chat:fileOperations.wantsToSearchReplace") : t("chat:fileOperations.didSearchReplace")}
-
-
- Search: - {tool.search} - {tool.useRegex && (regex)} - {tool.ignoreCase && ( - (case-insensitive) - )} -
-
- Replace: - {tool.replace} -
- {(tool.startLine !== undefined || tool.endLine !== undefined) && ( -
- Lines: - - {tool.startLine ?? 1} - {tool.endLine ?? "end"} - -
- )} -