Changesets · Branches · Tags · Compare
| Changeset | 562ef8278dce4ef714836d5f540804dad1b2e51e5220da22c7df1c499885a031 |
|---|---|
| Author | chezsmithy <chezsmithy@me.com> · 2025-07-11 18:00 -07:00 |
| Committer | chezsmithy <chezsmithy@me.com> · 2025-07-12 17:05 -07:00 |
| Parents | a2d235e8c1f1 |
4 files changed
modified core/tools/definitions/searchAndReplaceInFile.ts +16 −11
| @@ -3,7 +3,7 @@ | ||
| 3 | 3 | |
| 4 | 4 | export interface SearchAndReplaceInFileArgs { |
| 5 | 5 | filepath: string; |
| 6 | - diff: string; | |
| 6 | + diffs: string[]; | |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | /** |
| @@ -22,19 +22,22 @@ | ||
| 22 | 22 | function: { |
| 23 | 23 | name: BuiltInToolNames.SearchAndReplaceInFile, |
| 24 | 24 | description: |
| 25 | - "Request to replace sections of content in an existing file using SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.", | |
| 25 | + "Request to replace sections of content in an existing file using multiple SEARCH/REPLACE blocks that define exact changes to specific parts of the file. This tool should be used when you need to make targeted changes to specific parts of a file.", | |
| 26 | 26 | parameters: { |
| 27 | 27 | type: "object", |
| 28 | - required: ["filepath", "diff"], | |
| 28 | + required: ["filepath", "diffs"], | |
| 29 | 29 | properties: { |
| 30 | 30 | filepath: { |
| 31 | 31 | type: "string", |
| 32 | 32 | description: |
| 33 | 33 | "The path of the file to modify, relative to the root of the workspace.", |
| 34 | 34 | }, |
| 35 | - diff: { | |
| 36 | - type: "string", | |
| 37 | - description: `One or more SEARCH/REPLACE blocks following this exact format: | |
| 35 | + diffs: { | |
| 36 | + type: "array", | |
| 37 | + items: { | |
| 38 | + type: "string", | |
| 39 | + }, | |
| 40 | + description: `An array of strings, each containing one or more SEARCH/REPLACE blocks following this exact format: | |
| 38 | 41 | \`\`\` |
| 39 | 42 | ------- SEARCH |
| 40 | 43 | [exact content to find] |
| @@ -51,16 +54,17 @@ | ||
| 51 | 54 | * Including multiple unique SEARCH/REPLACE blocks if you need to make multiple changes. |
| 52 | 55 | * Include *just* enough lines in each SEARCH section to uniquely match each set of lines that need to change. |
| 53 | 56 | * When using multiple SEARCH/REPLACE blocks, list them in the order they appear in the file. |
| 54 | -3. Keep SEARCH/REPLACE blocks concise: | |
| 57 | +3. **Order matters**: DIFFs in the array should be ordered from top to bottom of the file to ensure correct application. | |
| 58 | +4. Keep SEARCH/REPLACE blocks concise: | |
| 55 | 59 | * Break large SEARCH/REPLACE blocks into a series of smaller blocks that each change a small portion of the file. |
| 56 | 60 | * Include just the changing lines, and a few surrounding lines if needed for uniqueness. |
| 57 | 61 | * Do not include long runs of unchanging lines in SEARCH/REPLACE blocks. |
| 58 | 62 | * Each line must be complete. Never truncate lines mid-way through as this can cause matching failures. |
| 59 | -4. Splitting up tool calls: | |
| 63 | +5. Splitting up tool calls: | |
| 60 | 64 | * When making multiple closely related edits to the same file, you should try to use multiple SEARCH/REPLACE blocks in a single tool call, rather than making multiple separate tool calls |
| 61 | 65 | * If you need to make follow up edits or group your work into logical segments, it is okay to perform additional tool calls |
| 62 | 66 | * DO NOT make back-to-back tool calls. Instead interleave with brief explanation of what each will do. For example, instead of [explanation, tool call, tool call] you should do [explanation, tool call, explanation, tool call] |
| 63 | -5. Special operations: | |
| 67 | +6. Special operations: | |
| 64 | 68 | * To move code: Use two SEARCH/REPLACE blocks (one to delete from original + one to insert at new location) |
| 65 | 69 | * To delete code: Use empty REPLACE section |
| 66 | 70 | |
| @@ -78,9 +82,10 @@ | ||
| 78 | 82 | [new content to replace with] |
| 79 | 83 | +++++++ REPLACE |
| 80 | 84 | \`\`\` |
| 81 | -`, | |
| 85 | + | |
| 86 | +Each string in the diffs array can contain multiple SEARCH/REPLACE blocks, and all will be applied sequentially in the order they appear.`, | |
| 82 | 87 | }, |
| 83 | 88 | }, |
| 84 | 89 | }, |
| 85 | 90 | }, |
| 86 | -}; | |
| 91 | +}; | |
| No newline at the end of the file |
modified gui/src/pages/gui/ToolCallDiv/FunctionSpecificToolCallDiv.tsx +2 −2
| @@ -37,7 +37,7 @@ | ||
| 37 | 37 | return ( |
| 38 | 38 | <EditFile |
| 39 | 39 | relativeFilePath={args.filepath ?? ""} |
| 40 | - changes={args.diff ?? ""} | |
| 40 | + changes={args.diffs ? args.diffs.join("\n\n---\n\n") : ""} | |
| 41 | 41 | toolCallId={toolCall.id} |
| 42 | 42 | historyIndex={historyIndex} |
| 43 | 43 | /> |
| @@ -55,4 +55,4 @@ | ||
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | -export default FunctionSpecificToolCallDiv; | |
| 58 | +export default FunctionSpecificToolCallDiv; | |
| No newline at the end of the file |
modified gui/src/util/clientTools/searchReplaceImpl.test.ts +197 −16
| @@ -53,24 +53,58 @@ | ||
| 53 | 53 | |
| 54 | 54 | await expect( |
| 55 | 55 | searchReplaceToolImpl( |
| 56 | - { filepath: "nonexistent.txt", diff: "some diff" }, | |
| 56 | + { filepath: "nonexistent.txt", diffs: ["some diff"] }, | |
| 57 | 57 | "tool-call-id", |
| 58 | 58 | mockExtras, |
| 59 | 59 | ), |
| 60 | 60 | ).rejects.toThrow("File nonexistent.txt does not exist"); |
| 61 | 61 | }); |
| 62 | 62 | |
| 63 | - it("should throw error when no search/replace blocks found", async () => { | |
| 63 | + it("should throw error when no search/replace blocks found in first diff", async () => { | |
| 64 | 64 | mockResolveRelativePathInDir.mockResolvedValue("/resolved/path/test.txt"); |
| 65 | 65 | mockParseAllSearchReplaceBlocks.mockReturnValue([]); |
| 66 | 66 | |
| 67 | 67 | await expect( |
| 68 | 68 | searchReplaceToolImpl( |
| 69 | - { filepath: "test.txt", diff: "invalid diff content" }, | |
| 69 | + { filepath: "test.txt", diffs: ["invalid diff content"] }, | |
| 70 | 70 | "tool-call-id", |
| 71 | 71 | mockExtras, |
| 72 | 72 | ), |
| 73 | - ).rejects.toThrow("No complete search/replace blocks found"); | |
| 73 | + ).rejects.toThrow("No complete search/replace blocks found in diff 1"); | |
| 74 | + }); | |
| 75 | + | |
| 76 | + it("should throw error when no search/replace blocks found in second diff", async () => { | |
| 77 | + mockResolveRelativePathInDir.mockResolvedValue("/resolved/path/test.txt"); | |
| 78 | + mockParseAllSearchReplaceBlocks | |
| 79 | + .mockReturnValueOnce([ | |
| 80 | + { | |
| 81 | + isComplete: true, | |
| 82 | + searchContent: "valid content", | |
| 83 | + replaceContent: "replacement", | |
| 84 | + }, | |
| 85 | + ]) | |
| 86 | + .mockReturnValueOnce([]); | |
| 87 | + | |
| 88 | + await expect( | |
| 89 | + searchReplaceToolImpl( | |
| 90 | + { filepath: "test.txt", diffs: ["valid diff", "invalid diff content"] }, | |
| 91 | + "tool-call-id", | |
| 92 | + mockExtras, | |
| 93 | + ), | |
| 94 | + ).rejects.toThrow("No complete search/replace blocks found in diff 2"); | |
| 95 | + }); | |
| 96 | + | |
| 97 | + it("should throw error when all diffs are empty", async () => { | |
| 98 | + mockResolveRelativePathInDir.mockResolvedValue("/resolved/path/test.txt"); | |
| 99 | + mockParseAllSearchReplaceBlocks.mockReturnValue([]); | |
| 100 | + | |
| 101 | + await expect( | |
| 102 | + searchReplaceToolImpl( | |
| 103 | + { filepath: "test.txt", diffs: [] }, | |
| 104 | + "tool-call-id", | |
| 105 | + mockExtras, | |
| 106 | + ), | |
| 107 | + ).rejects.toThrow("No complete search/replace blocks found in any diffs"); | |
| 74 | 108 | }); |
| 75 | 109 | }); |
| 76 | 110 | |
| @@ -110,7 +144,65 @@ | ||
| 110 | 144 | mockIdeMessenger.request.mockResolvedValue({ status: "success" }); |
| 111 | 145 | |
| 112 | 146 | const result = await searchReplaceToolImpl( |
| 113 | - { filepath: "test.js", diff: "mock diff content" }, | |
| 147 | + { filepath: "test.js", diffs: ["mock diff content"] }, | |
| 148 | + "tool-call-id", | |
| 149 | + mockExtras, | |
| 150 | + ); | |
| 151 | + | |
| 152 | + // Verify the result | |
| 153 | + expect(result).toEqual({ | |
| 154 | + respondImmediately: false, | |
| 155 | + output: undefined, | |
| 156 | + }); | |
| 157 | + | |
| 158 | + // Verify applyToFile was called with correct parameters | |
| 159 | + expect(mockIdeMessenger.request).toHaveBeenCalledWith("applyToFile", { | |
| 160 | + text: expectedFinalContent, | |
| 161 | + streamId: "test-stream-id", | |
| 162 | + filepath: "/resolved/path/test.js", | |
| 163 | + toolCallId: "tool-call-id", | |
| 164 | + isSearchAndReplace: true, | |
| 165 | + }); | |
| 166 | + }); | |
| 167 | + }); | |
| 168 | + | |
| 169 | + describe("single diff scenarios", () => { | |
| 170 | + it("should successfully apply single diff with single search/replace block", async () => { | |
| 171 | + const originalContent = `function hello() { | |
| 172 | + console.log("Hello"); | |
| 173 | + return "world"; | |
| 174 | +}`; | |
| 175 | + | |
| 176 | + const expectedFinalContent = `function hello() { | |
| 177 | + console.log("Hi there!"); | |
| 178 | + return "world"; | |
| 179 | +}`; | |
| 180 | + | |
| 181 | + // Setup mocks | |
| 182 | + mockResolveRelativePathInDir.mockResolvedValue("/resolved/path/test.js"); | |
| 183 | + mockParseAllSearchReplaceBlocks.mockReturnValue([ | |
| 184 | + { | |
| 185 | + isComplete: true, | |
| 186 | + searchContent: 'console.log("Hello");', | |
| 187 | + replaceContent: 'console.log("Hi there!");', | |
| 188 | + }, | |
| 189 | + ]); | |
| 190 | + mockIdeMessenger.ide.readFile.mockResolvedValue(originalContent); | |
| 191 | + | |
| 192 | + // Calculate correct positions for 'console.log("Hello");' in the original content | |
| 193 | + const searchText = 'console.log("Hello");'; | |
| 194 | + const startIndex = originalContent.indexOf(searchText); | |
| 195 | + const endIndex = startIndex + searchText.length; | |
| 196 | + | |
| 197 | + mockFindSearchMatch.mockReturnValue({ | |
| 198 | + startIndex, | |
| 199 | + endIndex, | |
| 200 | + strategyName: "exactMatch", | |
| 201 | + }); | |
| 202 | + mockIdeMessenger.request.mockResolvedValue({ status: "success" }); | |
| 203 | + | |
| 204 | + const result = await searchReplaceToolImpl( | |
| 205 | + { filepath: "test.js", diffs: ["mock diff content"] }, | |
| 114 | 206 | "tool-call-id", |
| 115 | 207 | mockExtras, |
| 116 | 208 | ); |
| @@ -191,7 +283,7 @@ | ||
| 191 | 283 | mockIdeMessenger.request.mockResolvedValue({ status: "success" }); |
| 192 | 284 | |
| 193 | 285 | const result = await searchReplaceToolImpl( |
| 194 | - { filepath: "test.js", diff: "mock diff content" }, | |
| 286 | + { filepath: "test.js", diffs: ["mock diff content"] }, | |
| 195 | 287 | "tool-call-id", |
| 196 | 288 | mockExtras, |
| 197 | 289 | ); |
| @@ -225,6 +317,95 @@ | ||
| 225 | 317 | }); |
| 226 | 318 | }); |
| 227 | 319 | |
| 320 | + describe("multiple diff scenarios", () => { | |
| 321 | + it("should successfully apply multiple diffs each with single search/replace block", async () => { | |
| 322 | + const originalContent = `const a = 1; | |
| 323 | +const b = 2; | |
| 324 | +const c = 3;`; | |
| 325 | + | |
| 326 | + const expectedFinalContent = `const a = 100; | |
| 327 | +const b = 200; | |
| 328 | +const c = 3;`; | |
| 329 | + | |
| 330 | + // Setup mocks - each diff returns one block | |
| 331 | + mockResolveRelativePathInDir.mockResolvedValue("/resolved/path/test.js"); | |
| 332 | + mockParseAllSearchReplaceBlocks | |
| 333 | + .mockReturnValueOnce([ | |
| 334 | + { | |
| 335 | + isComplete: true, | |
| 336 | + searchContent: "const a = 1;", | |
| 337 | + replaceContent: "const a = 100;", | |
| 338 | + }, | |
| 339 | + ]) | |
| 340 | + .mockReturnValueOnce([ | |
| 341 | + { | |
| 342 | + isComplete: true, | |
| 343 | + searchContent: "const b = 2;", | |
| 344 | + replaceContent: "const b = 200;", | |
| 345 | + }, | |
| 346 | + ]); | |
| 347 | + mockIdeMessenger.ide.readFile.mockResolvedValue(originalContent); | |
| 348 | + | |
| 349 | + // Calculate positions for sequential replacements | |
| 350 | + const firstSearchText = "const a = 1;"; | |
| 351 | + const secondSearchText = "const b = 2;"; | |
| 352 | + | |
| 353 | + const firstStartIndex = originalContent.indexOf(firstSearchText); | |
| 354 | + const firstEndIndex = firstStartIndex + firstSearchText.length; | |
| 355 | + | |
| 356 | + // After first replacement: "const a = 100;\nconst b = 2;\nconst c = 3;" | |
| 357 | + const contentAfterFirstReplacement = | |
| 358 | + originalContent.substring(0, firstStartIndex) + | |
| 359 | + "const a = 100;" + | |
| 360 | + originalContent.substring(firstEndIndex); | |
| 361 | + | |
| 362 | + const secondStartIndex = | |
| 363 | + contentAfterFirstReplacement.indexOf(secondSearchText); | |
| 364 | + const secondEndIndex = secondStartIndex + secondSearchText.length; | |
| 365 | + | |
| 366 | + // Mock sequential search matches | |
| 367 | + mockFindSearchMatch | |
| 368 | + .mockReturnValueOnce({ | |
| 369 | + startIndex: firstStartIndex, | |
| 370 | + endIndex: firstEndIndex, | |
| 371 | + strategyName: "exactMatch", | |
| 372 | + }) | |
| 373 | + .mockReturnValueOnce({ | |
| 374 | + startIndex: secondStartIndex, | |
| 375 | + endIndex: secondEndIndex, | |
| 376 | + strategyName: "exactMatch", | |
| 377 | + }); | |
| 378 | + | |
| 379 | + mockIdeMessenger.request.mockResolvedValue({ status: "success" }); | |
| 380 | + | |
| 381 | + const result = await searchReplaceToolImpl( | |
| 382 | + { filepath: "test.js", diffs: ["first diff", "second diff"] }, | |
| 383 | + "tool-call-id", | |
| 384 | + mockExtras, | |
| 385 | + ); | |
| 386 | + | |
| 387 | + // Verify the result | |
| 388 | + expect(result).toEqual({ | |
| 389 | + respondImmediately: false, | |
| 390 | + output: undefined, | |
| 391 | + }); | |
| 392 | + | |
| 393 | + // Verify parseAllSearchReplaceBlocks was called for each diff | |
| 394 | + expect(mockParseAllSearchReplaceBlocks).toHaveBeenCalledTimes(2); | |
| 395 | + expect(mockParseAllSearchReplaceBlocks).toHaveBeenNthCalledWith(1, "first diff"); | |
| 396 | + expect(mockParseAllSearchReplaceBlocks).toHaveBeenNthCalledWith(2, "second diff"); | |
| 397 | + | |
| 398 | + // Verify final applyToFile call | |
| 399 | + expect(mockIdeMessenger.request).toHaveBeenCalledWith("applyToFile", { | |
| 400 | + text: expectedFinalContent, | |
| 401 | + streamId: "test-stream-id", | |
| 402 | + filepath: "/resolved/path/test.js", | |
| 403 | + toolCallId: "tool-call-id", | |
| 404 | + isSearchAndReplace: true, | |
| 405 | + }); | |
| 406 | + }); | |
| 407 | + }); | |
| 408 | + | |
| 228 | 409 | describe("deletion scenarios", () => { |
| 229 | 410 | it("should handle empty replacement (deletion)", async () => { |
| 230 | 411 | const originalContent = `keep this |
| @@ -253,7 +434,7 @@ | ||
| 253 | 434 | mockIdeMessenger.request.mockResolvedValue({ status: "success" }); |
| 254 | 435 | |
| 255 | 436 | const result = await searchReplaceToolImpl( |
| 256 | - { filepath: "test.txt", diff: "mock diff content" }, | |
| 437 | + { filepath: "test.txt", diffs: ["mock diff content"] }, | |
| 257 | 438 | "tool-call-id", |
| 258 | 439 | mockExtras, |
| 259 | 440 | ); |
| @@ -293,7 +474,7 @@ | ||
| 293 | 474 | mockIdeMessenger.request.mockResolvedValue({ status: "success" }); |
| 294 | 475 | |
| 295 | 476 | await searchReplaceToolImpl( |
| 296 | - { filepath: "test.txt", diff: "mock diff content" }, | |
| 477 | + { filepath: "test.txt", diffs: ["mock diff content"] }, | |
| 297 | 478 | "tool-call-id", |
| 298 | 479 | mockExtras, |
| 299 | 480 | ); |
| @@ -323,7 +504,7 @@ | ||
| 323 | 504 | |
| 324 | 505 | await expect( |
| 325 | 506 | searchReplaceToolImpl( |
| 326 | - { filepath: "test.txt", diff: "mock diff content" }, | |
| 507 | + { filepath: "test.txt", diffs: ["mock diff content"] }, | |
| 327 | 508 | "tool-call-id", |
| 328 | 509 | mockExtras, |
| 329 | 510 | ), |
| @@ -361,7 +542,7 @@ | ||
| 361 | 542 | |
| 362 | 543 | await expect( |
| 363 | 544 | searchReplaceToolImpl( |
| 364 | - { filepath: "test.txt", diff: "mock diff content" }, | |
| 545 | + { filepath: "test.txt", diffs: ["mock diff content"] }, | |
| 365 | 546 | "tool-call-id", |
| 366 | 547 | mockExtras, |
| 367 | 548 | ), |
| @@ -385,7 +566,7 @@ | ||
| 385 | 566 | |
| 386 | 567 | await expect( |
| 387 | 568 | searchReplaceToolImpl( |
| 388 | - { filepath: "test.txt", diff: "mock diff content" }, | |
| 569 | + { filepath: "test.txt", diffs: ["mock diff content"] }, | |
| 389 | 570 | "tool-call-id", |
| 390 | 571 | mockExtras, |
| 391 | 572 | ), |
| @@ -411,7 +592,7 @@ | ||
| 411 | 592 | |
| 412 | 593 | await expect( |
| 413 | 594 | searchReplaceToolImpl( |
| 414 | - { filepath: "test.txt", diff: "mock diff content" }, | |
| 595 | + { filepath: "test.txt", diffs: ["mock diff content"] }, | |
| 415 | 596 | "tool-call-id", |
| 416 | 597 | mockExtras, |
| 417 | 598 | ), |
| @@ -441,7 +622,7 @@ | ||
| 441 | 622 | mockIdeMessenger.request.mockResolvedValue({ status: "success" }); |
| 442 | 623 | |
| 443 | 624 | await searchReplaceToolImpl( |
| 444 | - { filepath: "test.txt", diff: "mock diff content" }, | |
| 625 | + { filepath: "test.txt", diffs: ["mock diff content"] }, | |
| 445 | 626 | "tool-call-id", |
| 446 | 627 | mockExtras, |
| 447 | 628 | ); |
| @@ -476,7 +657,7 @@ | ||
| 476 | 657 | mockIdeMessenger.request.mockResolvedValue({ status: "success" }); |
| 477 | 658 | |
| 478 | 659 | await searchReplaceToolImpl( |
| 479 | - { filepath: "test.txt", diff: "mock diff content" }, | |
| 660 | + { filepath: "test.txt", diffs: ["mock diff content"] }, | |
| 480 | 661 | "tool-call-id", |
| 481 | 662 | mockExtras, |
| 482 | 663 | ); |
| @@ -512,7 +693,7 @@ | ||
| 512 | 693 | mockIdeMessenger.request.mockResolvedValue({ status: "success" }); |
| 513 | 694 | |
| 514 | 695 | await searchReplaceToolImpl( |
| 515 | - { filepath: "relative/test.txt", diff: "mock diff content" }, | |
| 696 | + { filepath: "relative/test.txt", diffs: ["mock diff content"] }, | |
| 516 | 697 | "tool-call-id", |
| 517 | 698 | mockExtras, |
| 518 | 699 | ); |
| @@ -538,4 +719,4 @@ | ||
| 538 | 719 | }); |
| 539 | 720 | }); |
| 540 | 721 | }); |
| 541 | -}); | |
| 722 | +}); | |
| No newline at the end of the file |
modified gui/src/util/clientTools/searchReplaceImpl.ts +15 −8
| @@ -10,7 +10,7 @@ | ||
| 10 | 10 | toolCallId, |
| 11 | 11 | extras, |
| 12 | 12 | ) => { |
| 13 | - const { filepath, diff } = args; | |
| 13 | + const { filepath, diffs } = args; | |
| 14 | 14 | |
| 15 | 15 | const state = extras.getState(); |
| 16 | 16 | const allowAnonymousTelemetry = state.config.config.allowAnonymousTelemetry; |
| @@ -26,11 +26,18 @@ | ||
| 26 | 26 | throw new Error(`File ${filepath} does not exist`); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - // Parse all search/replace blocks from the diff content | |
| 30 | - const blocks = parseAllSearchReplaceBlocks(diff); | |
| 29 | + // Parse all search/replace blocks from all diff strings | |
| 30 | + const allBlocks = []; | |
| 31 | + for (let diffIndex = 0; diffIndex < diffs.length; diffIndex++) { | |
| 32 | + const blocks = parseAllSearchReplaceBlocks(diffs[diffIndex]); | |
| 33 | + if (blocks.length === 0) { | |
| 34 | + throw new Error(`No complete search/replace blocks found in diff ${diffIndex + 1}`); | |
| 35 | + } | |
| 36 | + allBlocks.push(...blocks); | |
| 37 | + } | |
| 31 | 38 | |
| 32 | - if (blocks.length === 0) { | |
| 33 | - throw new Error("No complete search/replace blocks found"); | |
| 39 | + if (allBlocks.length === 0) { | |
| 40 | + throw new Error("No complete search/replace blocks found in any diffs"); | |
| 34 | 41 | } |
| 35 | 42 | |
| 36 | 43 | try { |
| @@ -40,8 +47,8 @@ | ||
| 40 | 47 | let currentContent = originalContent; |
| 41 | 48 | |
| 42 | 49 | // Apply all replacements sequentially to build the final content |
| 43 | - for (let i = 0; i < blocks.length; i++) { | |
| 44 | - const block = blocks[i]; | |
| 50 | + for (let i = 0; i < allBlocks.length; i++) { | |
| 51 | + const block = allBlocks[i]; | |
| 45 | 52 | const { searchContent, replaceContent } = block; |
| 46 | 53 | |
| 47 | 54 | // Find the search content in the current state of the file |
| @@ -91,4 +98,4 @@ | ||
| 91 | 98 | `Failed to apply search and replace: ${error instanceof Error ? error.message : String(error)}`, |
| 92 | 99 | ); |
| 93 | 100 | } |
| 94 | -}; | |
| 101 | +}; | |
| No newline at the end of the file |