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
`The user made the following updates to your content:\n\n${userEdits}\n\n`+
1248
+
`The updated content, which includes both your original modifications and the user's edits, has been successfully saved to ${relPath.toPosix()}. Here is the full, updated content of the file:\n\n`+
Copy file name to clipboardExpand all lines: src/core/prompts/system.ts
+21-2Lines changed: 21 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -69,10 +69,29 @@ Your file content here
69
69
70
70
${diffEnabled ? `
71
71
## apply_diff
72
-
Description: Apply a diff to a file at the specified path. The diff should be in unified format (diff -u) and can be used to apply changes to a file. This tool is useful when you need to make specific modifications to a file based on a set of changes provided in a diff.
72
+
Description: Apply a diff to a file at the specified path. The diff should be in unified format ('diff -U0') and can be used to apply changes to a file. This tool is useful when you need to make specific modifications to a file based on a set of changes provided in a diff.
73
+
74
+
- Make sure you include the first 2 lines with the file paths.
75
+
- Don't include timestamps with the file paths.
76
+
- Start each hunk of changes with a '@@ ... @@' line. Don't include line numbers like 'diff -U0' does. The user's patch tool doesn't need them.
77
+
- The user's patch tool needs CORRECT patches that apply cleanly against the current contents of the file!
78
+
- Think carefully and make sure you include and mark all lines that need to be removed or changed as '-' lines.
79
+
- Make sure you mark all new or modified lines with '+'.
80
+
- Don't leave out any lines or the diff patch won't apply correctly.
81
+
- Indentation matters in the diffs!
82
+
- Start a new hunk for each section of the file that needs changes.
83
+
- Only output hunks that specify changes with '+' or '-' lines.
84
+
- Skip any hunks that are entirely unchanging ' ' lines.
85
+
- Output hunks in whatever order makes the most sense.
86
+
- Hunks don't need to be in any particular order.
87
+
- When editing a function, method, loop, etc use a hunk to replace the *entire* code block.
88
+
- Delete the entire existing version with '-' lines and then add a new, updated version with '+' lines.
89
+
- This will help you generate correct code and correct diffs.
90
+
- To move code within a file, use 2 hunks: 1 to delete it from its current location, 1 to insert it in the new location.
91
+
73
92
Parameters:
74
93
- path: (required) The path of the file to apply the diff to (relative to the current working directory ${cwd.toPosix()})
75
-
- diff: (required) The diff in unified format (diff -u) to apply to the file.
94
+
- diff: (required) The diff in unified format (diff -U0) to apply to the file.
0 commit comments