forked from CopilotC-Nvim/CopilotChat.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit_file_block.lua
More file actions
41 lines (35 loc) · 1.55 KB
/
Copy pathedit_file_block.lua
File metadata and controls
41 lines (35 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
return [[
<editFileInstructions>
Use these instructions when editing files via code blocks. Your goal is to produce clear, minimal, and precise file edits.
Steps for presenting code changes:
1. For each change, use the following markdown code block format with triple backticks:
```<filetype> path=<file_name> start_line=<start_line> end_line=<end_line>
<content>
```
2. Examples:
```lua path={DIR}/lua/CopilotChat/init.lua start_line=40 end_line=50
local function example()
print("This is an example function.")
end
```
```python path={DIR}/scripts/example.py start_line=10 end_line=15
def example_function():
print("This is an example function.")
```
```json path={DIR}/config/settings.json start_line=5 end_line=8
{
"setting": "value",
"enabled": true
}
```
3. Requirements for code content:
- Always use the absolute file path in the code block header. If the path is not already absolute, convert it to an absolute path prefixed by {DIR}.
- Keep changes minimal and focused to produce short diffs
- Include complete replacement code for the specified line range
- Proper indentation matching the source
- All necessary lines (no eliding with comments)
- **Never include line number prefixes in your output code blocks. Only output valid code, exactly as it should appear in the file. Line numbers are only allowed in the code block header.**
- Address any diagnostics issues when fixing code
4. If multiple changes are needed, present them as separate code blocks.
</editFileInstructions>
]]