prettier fixes
This commit is contained in:
parent
233bd45d2f
commit
3ac016ad8c
4 changed files with 19 additions and 8 deletions
|
|
@ -88,4 +88,4 @@ Each string in the diffs array can contain multiple SEARCH/REPLACE blocks, and a
|
|||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -55,4 +55,4 @@ function FunctionSpecificToolCallDiv({
|
|||
}
|
||||
}
|
||||
|
||||
export default FunctionSpecificToolCallDiv;
|
||||
export default FunctionSpecificToolCallDiv;
|
||||
|
|
|
|||
|
|
@ -87,7 +87,10 @@ describe("searchReplaceToolImpl", () => {
|
|||
|
||||
await expect(
|
||||
searchReplaceToolImpl(
|
||||
{ filepath: "test.txt", diffs: ["valid diff", "invalid diff content"] },
|
||||
{
|
||||
filepath: "test.txt",
|
||||
diffs: ["valid diff", "invalid diff content"],
|
||||
},
|
||||
"tool-call-id",
|
||||
mockExtras,
|
||||
),
|
||||
|
|
@ -392,8 +395,14 @@ const c = 3;`;
|
|||
|
||||
// Verify parseAllSearchReplaceBlocks was called for each diff
|
||||
expect(mockParseAllSearchReplaceBlocks).toHaveBeenCalledTimes(2);
|
||||
expect(mockParseAllSearchReplaceBlocks).toHaveBeenNthCalledWith(1, "first diff");
|
||||
expect(mockParseAllSearchReplaceBlocks).toHaveBeenNthCalledWith(2, "second diff");
|
||||
expect(mockParseAllSearchReplaceBlocks).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
"first diff",
|
||||
);
|
||||
expect(mockParseAllSearchReplaceBlocks).toHaveBeenNthCalledWith(
|
||||
2,
|
||||
"second diff",
|
||||
);
|
||||
|
||||
// Verify final applyToFile call
|
||||
expect(mockIdeMessenger.request).toHaveBeenCalledWith("applyToFile", {
|
||||
|
|
@ -719,4 +728,4 @@ keep this too`;
|
|||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -31,7 +31,9 @@ export const searchReplaceToolImpl: ClientToolImpl = async (
|
|||
for (let diffIndex = 0; diffIndex < diffs.length; diffIndex++) {
|
||||
const blocks = parseAllSearchReplaceBlocks(diffs[diffIndex]);
|
||||
if (blocks.length === 0) {
|
||||
throw new Error(`No complete search/replace blocks found in diff ${diffIndex + 1}`);
|
||||
throw new Error(
|
||||
`No complete search/replace blocks found in diff ${diffIndex + 1}`,
|
||||
);
|
||||
}
|
||||
allBlocks.push(...blocks);
|
||||
}
|
||||
|
|
@ -98,4 +100,4 @@ export const searchReplaceToolImpl: ClientToolImpl = async (
|
|||
`Failed to apply search and replace: ${error instanceof Error ? error.message : String(error)}`,
|
||||
);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue