Skip to content

Commit 48c9bd5

Browse files
authored
Encourage use of start_line in multi-file diff to match legacy diff (#4777)
1 parent e95c1e8 commit 48c9bd5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/diff/strategies/multi-file-search-replace.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,12 @@ Parameters:
107107
- path: (required) The path of the file to modify (relative to the current workspace directory ${args.cwd})
108108
- diff: (required) One or more diff elements containing:
109109
- content: (required) The search/replace block defining the changes.
110-
- start_line: (optional) The line number of original content where the search block starts.
110+
- start_line: (required) The line number of original content where the search block starts.
111111
112112
Diff format:
113113
\`\`\`
114114
<<<<<<< SEARCH
115-
:start_line: (optional) The line number of original content where the search block starts.
115+
:start_line: (required) The line number of original content where the search block starts.
116116
-------
117117
[exact content to find including whitespace]
118118
=======
@@ -294,7 +294,7 @@ Each file requires its own path, start_line, and diff elements.
294294
"\n" +
295295
"CORRECT FORMAT:\n\n" +
296296
"<<<<<<< SEARCH\n" +
297-
":start_line: (optional) The line number of original content where the search block starts.\n" +
297+
":start_line: (required) The line number of original content where the search block starts.\n" +
298298
"-------\n" +
299299
"[exact content to find including whitespace]\n" +
300300
"=======\n" +

src/core/tools/multiApplyDiffTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Expected structure:
153153
<path>relative/path/to/file.ext</path>
154154
<diff>
155155
<content>diff content here</content>
156-
<start_line>optional line number</start_line>
156+
<start_line>line number</start_line>
157157
</diff>
158158
</file>
159159
</args>

0 commit comments

Comments
 (0)