Skip to content
1 change: 1 addition & 0 deletions packages/opencode/src/tool/edit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Usage:
- Only use emojis if the user explicitly requests it. Avoid adding emojis to files unless asked.
- The edit will FAIL if `oldString` is not found in the file with an error "oldString not found in content".
- The edit will FAIL if `oldString` is found multiple times in the file with an error "oldString found multiple times and requires more code context to uniquely identify the intended match". Either provide a larger string with more surrounding context to make it unique or use `replaceAll` to change every instance of `oldString`.
- The edit will FAIL if `oldString` and `newString` are identical strings: you MUST NEVER pass identical arguments for the `oldString` and `newString` arguments!
- Use `replaceAll` for replacing and renaming strings across the file. This parameter is useful if you want to rename a variable for instance.