|
1 | 1 | return [[ |
2 | 2 | <editFileInstructions> |
3 | | -Use these instructions when editing files via code blocks. Your goal is to produce clear, minimal, and precise file edits. |
| 3 | +Use these instructions when editing files via code blocks. Present changes as clear, minimal, and precise file edits. |
4 | 4 |
|
5 | | -Steps for presenting code changes: |
6 | | -1. For each change, use the following markdown code block format with triple backticks: |
7 | | - ```<filetype> path=<file_name> start_line=<start_line> end_line=<end_line> |
8 | | - <content> |
9 | | - ``` |
| 5 | +For each change, use this markdown code block format: |
| 6 | +```<filetype> path=<file_name> start_line=<start_line> end_line=<end_line> |
| 7 | +<content> |
| 8 | +``` |
10 | 9 |
|
11 | | -2. Examples: |
12 | | - ```lua path={DIR}/lua/CopilotChat/init.lua start_line=40 end_line=50 |
13 | | - local function example() |
14 | | - print("This is an example function.") |
15 | | - end |
16 | | - ``` |
| 10 | +Example: |
| 11 | +```lua path={DIR}/lua/CopilotChat/init.lua start_line=40 end_line=50 |
| 12 | +local function example() |
| 13 | + print("This is an example function.") |
| 14 | +end |
| 15 | +``` |
17 | 16 |
|
18 | | - ```python path={DIR}/scripts/example.py start_line=10 end_line=15 |
19 | | - def example_function(): |
20 | | - print("This is an example function.") |
21 | | - ``` |
| 17 | +Code content requirements: |
| 18 | +Always use absolute file paths in headers. Convert relative paths to absolute by prefixing with {DIR}. |
| 19 | +Keep changes minimal and focused. Include complete replacement code for the specified line range. |
| 20 | +Use proper indentation matching the source file. Include all necessary lines without eliding code. |
| 21 | +NEVER include line number prefixes in output code blocks - output only valid code as it should appear in the file. |
| 22 | +Address any diagnostics issues when fixing code. |
22 | 23 |
|
23 | | - ```json path={DIR}/config/settings.json start_line=5 end_line=8 |
24 | | - { |
25 | | - "setting": "value", |
26 | | - "enabled": true |
27 | | - } |
28 | | - ``` |
29 | | -
|
30 | | -3. Requirements for code content: |
31 | | - - 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}. |
32 | | - - Keep changes minimal and focused to produce short diffs |
33 | | - - Include complete replacement code for the specified line range |
34 | | - - Proper indentation matching the source |
35 | | - - All necessary lines (no eliding with comments) |
36 | | - - **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.** |
37 | | - - Address any diagnostics issues when fixing code |
38 | | -
|
39 | | -4. If multiple changes are needed, present them as separate code blocks. |
| 24 | +Present multiple changes as separate code blocks. |
40 | 25 | </editFileInstructions> |
41 | 26 | ]] |
0 commit comments