Refactor file editing to DiffViewProvider

This commit is contained in:
Saoud Rizwan
2024-09-29 18:17:54 -04:00
parent 2ed84244d5
commit 8b243fa536
3 changed files with 421 additions and 726 deletions

View File

@@ -76,7 +76,7 @@ export const formatResponse = {
}
},
createPrettyPatch: (filename = "file", oldStr: string, newStr: string) => {
createPrettyPatch: (filename = "file", oldStr?: string, newStr?: string) => {
// strings cannot be undefined or diff throws exception
const patch = diff.createPatch(filename.toPosix(), oldStr || "", newStr || "")
const lines = patch.split("\n")