You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'String "Hello" appears 3 times in the file. Either provide a more specific string with surrounding context to make it unique, or use replace_all=true to replace all occurrences.',
174
+
`String "Hello" appears 3 times in the file. ${FOUND_MULTIPLE_FIND_STRINGS_ERROR}`,
'Edit #2: String "test" appears 3 times in the file. Either provide a more specific string with surrounding context to make it unique, or use replace_all=true to replace all occurrences.',
184
+
`edit at index 1: String "test" appears 3 times in the file. ${FOUND_MULTIPLE_FIND_STRINGS_ERROR}`,
consterrorContext=index!==undefined ? `edit at index ${index}: ` : "";
14
17
// Check if old_string exists in current content
15
18
if(!content.includes(oldString)){
16
-
thrownewError(`${errorContext}String not found in file: "${oldString}"`);
19
+
thrownewError(`${errorContext}string not found in file: "${oldString}"`);
17
20
}
18
21
19
22
if(replaceAll){
@@ -35,7 +38,7 @@ export function performFindAndReplace(
35
38
36
39
if(count>1){
37
40
thrownewError(
38
-
`${errorContext}String "${oldString}" appears ${count} times in the file. Either provide a more specific string with surrounding context to make it unique, or use replace_all=true to replace all occurrences.`,
41
+
`${errorContext}String "${oldString}" appears ${count} times in the file. ${FOUND_MULTIPLE_FIND_STRINGS_ERROR}`,
39
42
);
40
43
}
41
44
@@ -57,7 +60,7 @@ export function validateSingleEdit(
'Edit #1: String "test" appears 3 times in the file. Either provide a more specific string with surrounding context to make it unique, or use replace_all=true to replace all occurrences.',
227
+
`edit at index 0: String "test" appears 3 times in the file. ${FOUND_MULTIPLE_FIND_STRINGS_ERROR}`,
0 commit comments