@@ -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