mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
fix: add recordToolUsage call after successful edit in EditFileAnthropicTool
This commit is contained in:
parent
c892cd097e
commit
a4b38fdb8f
1 changed files with 6 additions and 5 deletions
|
|
@ -126,11 +126,11 @@ export class SearchAndReplaceTool extends BaseTool<"edit_file_anthropic"> {
|
|||
let newContent = fileContent
|
||||
const errors: string[] = []
|
||||
|
||||
for (let i = 0; i < edits.length; i++) {
|
||||
// Normalize line endings in search/replace strings to match file content
|
||||
const old_text = edits[i].old_text.replace(/\r\n/g, "\n")
|
||||
const new_text = edits[i].new_text.replace(/\r\n/g, "\n")
|
||||
const searchPattern = new RegExp(escapeRegExp(old_text), "g")
|
||||
for (let i = 0; i < edits.length; i++) {
|
||||
// Normalize line endings in search/replace strings to match file content
|
||||
const old_text = edits[i].old_text.replace(/\r\n/g, "\n")
|
||||
const new_text = edits[i].new_text.replace(/\r\n/g, "\n")
|
||||
const searchPattern = new RegExp(escapeRegExp(old_text), "g")
|
||||
|
||||
const matchCount = newContent.match(searchPattern)?.length ?? 0
|
||||
if (matchCount === 0) {
|
||||
|
|
@ -245,6 +245,7 @@ export class SearchAndReplaceTool extends BaseTool<"edit_file_anthropic"> {
|
|||
}
|
||||
|
||||
task.didEditFile = true
|
||||
task.recordToolUsage("edit_file_anthropic")
|
||||
|
||||
// Get the formatted response message
|
||||
const message = await task.diffViewProvider.pushToolWriteResult(task, task.cwd, false)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue