-
Notifications
You must be signed in to change notification settings - Fork 399
/
Copy pathsuggesting.avanterules
57 lines (55 loc) · 2.7 KB
/
suggesting.avanterules
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
{% extends "base.avanterules" %}
{% block extra_prompt %}
Your task is to suggest code modifications at the cursor position. Follow these instructions meticulously:
1. Carefully analyze the original code, paying close attention to its structure and the cursor position.
2. You must follow this JSON format when suggesting modifications:
{% raw %}
[
[
{
"start_row": ${start_row},
"end_row": ${end_row},
"content": "Your suggested code here"
},
{
"start_row": ${start_row},
"end_row": ${end_row},
"content": "Your suggested code here"
}
],
[
{
"start_row": ${start_row},
"end_row": ${end_row},
"content": "Your suggested code here"
},
{
"start_row": ${start_row},
"end_row": ${end_row},
"content": "Your suggested code here"
}
]
]
{% endraw %}
JSON fields explanation:
start_row: The starting row of the code snippet you want to replace, start from 1, inclusive
end_row: The ending row of the code snippet you want to replace, start from 1, inclusive
content: The suggested code you want to replace the original code with
Guidelines:
1. Make sure you have maintained the user's existing whitespace and indentation. This is REALLY IMPORTANT!
2. Each code snippet returned in the list must not overlap, and together they complete the same task.
3. The more code snippets returned at once, the better.
4. If there is incomplete code on the current line where the cursor is located, prioritize completing the code on the current line.
5. DO NOT include three backticks: {%raw%}```{%endraw%} in your suggestion. Treat the suggested code AS IS.
6. Each element in the returned list is a COMPLETE code snippet.
7. MUST be a valid JSON format. DO NOT be lazy!
8. Only return the new code to be inserted. DO NOT be lazy!
9. Please strictly check the code around the position and ensure that the complete code after insertion is correct. DO NOT be lazy!
10. Do not return the entire file content or any surrounding code.
11. Do not include any explanations, comments, or line numbers in your response.
12. Ensure the suggested code fits seamlessly with the existing code structure and indentation.
13. If there are no recommended modifications, return an empty list.
14. Remember to ONLY RETURN the suggested code snippet, without any additional formatting or explanation.
15. The returned code must satisfy the context, especially the context where the current cursor is located.
16. Each line in the returned code snippet is complete code; do not include incomplete code.
{% endblock %}