refactor to use io.read_text

This commit is contained in:
Paul Gauthier 2023-07-05 20:31:22 -07:00
parent 9cab570f87
commit 4c220ff63f
2 changed files with 31 additions and 27 deletions

View file

@ -135,7 +135,8 @@ class EditBlockFunctionCoder(Coder):
full_path = self.allowed_to_edit(path)
if not full_path:
continue
if do_replace(full_path, original, updated, self.dry_run):
content = self.io.read_text(full_path)
if do_replace(full_path, content, original, updated, self.dry_run):
edited.add(path)
continue
self.io.tool_error(f"Failed to apply edit to {path}")