-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Description
TLDR
Added by @jackwotherspoon.
Here are main issues being seen with the replace tool:
Error: Failed to edit, could not find the string to replace.replacetool misinterprets literal newline characters in theold_stringornew_stringparameters, leading to syntax errors in the generated code. It seems to treat\nas an actual newline instead of the escaped character0 occurrences found for old_string.No changes detected
Bug Description
Describe the bug
Here's a very common pattern of GCLI encountered the Error: Failed to edit, could not find the string to replace. error with the replace tool and had to switch to write_file.
'''
✦ I've updated ChatInput.tsx. Now I will fix the errors in VimInput.tsx.
──────────────────────────────────────────────────
│ ✔ Edit ...ges/cli/src/ui/components/VimInput.tsx: interface VimInputProps {... => interface VimInputProps {... │
│ │
│ Error: Failed to edit, could not find the string to replace. │
──────────────────────────────────────────────────
✦ I apologize for the error. It seems I'm still having trouble with the replace tool. I will use write_file to update the VimInput.tsx
file. I will first read the file, then modify the content in memory, and finally write the new content to the file.
╭────────────────────────────────────────────────────────╮
│ ✔ ReadFile ...ges/cli/src/ui/components/VimInput.tsx │
╰────────────────────────────────────────────────────────╯
✦ I have the latest version of the VimInput.tsx file. I will now remove the unused value and onChange props and fix the any type in the
vimDispatch prop.
╭─────────────────────────────────────────────────
│ ✔ WriteFile Writing to ...ges/cli/src/ui/components/VimInput.tsx │
│ │
│ 8 import { VimState } from './vim.js'; │
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status