Refactor applyDiff method to return a Promise and add logging for diff results

This commit is contained in:
Daniel Riccio
2025-01-07 18:57:40 -05:00
parent 6bcde01778
commit 4356cffb0d
2 changed files with 4 additions and 3 deletions

View File

@@ -1277,7 +1277,7 @@ export class Cline {
const originalContent = await fs.readFile(absolutePath, "utf-8")
// Apply the diff to the original content
const diffResult = this.diffStrategy?.applyDiff(
const diffResult = await this.diffStrategy?.applyDiff(
originalContent,
diffContent,
parseInt(block.params.start_line ?? ''),
@@ -1286,6 +1286,7 @@ export class Cline {
success: false,
error: "No diff strategy available"
}
console.log("diffResult", diffResult)
if (!diffResult.success) {
this.consecutiveMistakeCount++
const currentCount = (this.consecutiveMistakeCountForApplyDiff.get(relPath) || 0) + 1