From 36b7da07d2ba00acf43a9c778f26308326c2f2e9 Mon Sep 17 00:00:00 2001 From: Daniel Riccio Date: Wed, 15 Jan 2025 12:55:44 -0500 Subject: [PATCH] fix: enhance error messaging in diff strategy to address potential issues with context lines and version targeting --- src/core/diff/strategies/new-unified/index.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/diff/strategies/new-unified/index.ts b/src/core/diff/strategies/new-unified/index.ts index c8ca119..f212bb9 100644 --- a/src/core/diff/strategies/new-unified/index.ts +++ b/src/core/diff/strategies/new-unified/index.ts @@ -230,6 +230,10 @@ Your diff here errorMsg += "\nPossible Issues:\n" errorMsg += "- Too many context lines may reduce search accuracy\n" errorMsg += "- Try to keep only 2-3 lines of context before and after changes\n" + } else { + errorMsg += "\nPossible Issues:\n" + errorMsg += "- The diff may be targeting a different version of the file\n" + errorMsg += "- There may be too many changes in a single hunk, try splitting the changes into multiple hunks\n" } if (startLine && endLine) {