Skip to content

Commit e8aae6c

Browse files
yetoneappaquet
andauthored
fix: copilot replace_in_file example (#2239)
Co-authored-by: Andre-Philippe Paquet <[email protected]>
1 parent b390bb0 commit e8aae6c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lua/avante/llm_tools/replace_in_file.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ One or more SEARCH/REPLACE blocks following this exact format:
4040
[new content to replace with]
4141
+++++++ REPLACE
4242
\`\`\`
43+
44+
Example:
45+
\`\`\`
46+
------- SEARCH
47+
func my_function(param1, param2) {
48+
// This is a comment
49+
console.log(param1);
50+
}
51+
=======
52+
func my_function(param1, param2) {
53+
// This is a modified comment
54+
console.log(param2);
55+
}
56+
+++++++ REPLACE
57+
\`\`\`
58+
4359
Critical rules:
4460
1. SEARCH content must match the associated file section to find EXACTLY:
4561
* Do not refer to the `diff` argument of the previous `replace_in_file` function call for SEARCH content matching, as it may have been modified. Always match from the latest file content in <selected_files> or from the `view` function call result.

0 commit comments

Comments
 (0)