mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
Refactor applyDiff methods in search-replace and unified strategies to return Promises for asynchronous handling
This commit is contained in:
parent
420c6c72dd
commit
70cf27071b
2 changed files with 2 additions and 2 deletions
|
|
@ -126,7 +126,7 @@ Your search/replace content here
|
|||
</apply_diff>`
|
||||
}
|
||||
|
||||
applyDiff(originalContent: string, diffContent: string, startLine?: number, endLine?: number): DiffResult {
|
||||
async applyDiff(originalContent: string, diffContent: string, startLine?: number, endLine?: number): Promise<DiffResult> {
|
||||
// Extract the search and replace blocks
|
||||
const match = diffContent.match(/<<<<<<< SEARCH\n([\s\S]*?)\n?=======\n([\s\S]*?)\n?>>>>>>> REPLACE/);
|
||||
if (!match) {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ Your diff here
|
|||
</apply_diff>`
|
||||
}
|
||||
|
||||
applyDiff(originalContent: string, diffContent: string): DiffResult {
|
||||
async applyDiff(originalContent: string, diffContent: string): Promise<DiffResult> {
|
||||
try {
|
||||
const result = applyPatch(originalContent, diffContent)
|
||||
if (result === false) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue