Skip to content

Commit f2c492a

Browse files
chore: generate
1 parent 0556774 commit f2c492a

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/opencode/src/tool/apply_patch.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ export const ApplyPatchTool = Tool.defineEffect(
142142
}
143143

144144
case "delete": {
145-
const contentToDelete = yield* afs.readFileString(filePath).pipe(
146-
Effect.catch((error) => Effect.fail(new Error(`apply_patch verification failed: ${error}`))),
147-
)
145+
const contentToDelete = yield* afs
146+
.readFileString(filePath)
147+
.pipe(Effect.catch((error) => Effect.fail(new Error(`apply_patch verification failed: ${error}`))))
148148
const deleteDiff = trimDiff(createTwoFilesPatch(filePath, filePath, contentToDelete, ""))
149149

150150
const deletions = contentToDelete.split("\n").length
@@ -199,7 +199,7 @@ export const ApplyPatchTool = Tool.defineEffect(
199199
switch (change.type) {
200200
case "add":
201201
// Create parent directories (recursive: true is safe on existing/root dirs)
202-
202+
203203
yield* afs.writeWithDirs(change.filePath, change.newContent)
204204
updates.push({ file: change.filePath, event: "add" })
205205
break
@@ -212,7 +212,7 @@ export const ApplyPatchTool = Tool.defineEffect(
212212
case "move":
213213
if (change.movePath) {
214214
// Create parent directories (recursive: true is safe on existing/root dirs)
215-
215+
216216
yield* afs.writeWithDirs(change.movePath!, change.newContent)
217217
yield* afs.remove(change.filePath)
218218
updates.push({ file: change.filePath, event: "unlink" })
@@ -269,9 +269,7 @@ export const ApplyPatchTool = Tool.defineEffect(
269269
if (errors.length > 0) {
270270
const limited = errors.slice(0, MAX_DIAGNOSTICS_PER_FILE)
271271
const suffix =
272-
errors.length > MAX_DIAGNOSTICS_PER_FILE
273-
? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more`
274-
: ""
272+
errors.length > MAX_DIAGNOSTICS_PER_FILE ? `\n... and ${errors.length - MAX_DIAGNOSTICS_PER_FILE} more` : ""
275273
output += `\n\nLSP errors detected in ${path.relative(Instance.worktree, target).replaceAll("\\", "/")}, please fix:\n<diagnostics file="${target}">\n${limited.map(LSP.Diagnostic.pretty).join("\n")}${suffix}\n</diagnostics>`
276274
}
277275
}

0 commit comments

Comments
 (0)