feat: tab flow (#1077)

This commit is contained in:
yetone
2025-01-14 15:39:57 +08:00
committed by GitHub
parent ba9f014b75
commit bd8afce3b0
6 changed files with 353 additions and 115 deletions

View File

@@ -5,22 +5,45 @@ Your task is to suggest code modifications at the cursor position. Follow these
2. You must follow this JSON format when suggesting modifications:
{% raw %}
[
{
"row": ${row},
"col": ${column},
"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"
},
{
"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 (1-indexed), inclusive
end_row: The ending row of the code snippet you want to replace (1-indexed), 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. DO NOT include three backticks: {%raw%}```{%endraw%} in your suggestion. Treat the suggested code AS IS.
3. Each element in the returned list is a COMPLETE and INDEPENDENT code snippet.
4. MUST be a valid JSON format. DON NOT be lazy!
5. Only return the new code to be inserted.
6. Your returned code should not overlap with the original code in any way. Don't be lazy!
7. Please strictly check the code around the position and ensure that the complete code after insertion is correct. Don't be lazy!
2. Each segment in the returned list must be non-overlapping, and together they constitute this code modification.
3. DO NOT include three backticks: {%raw%}```{%endraw%} in your suggestion. Treat the suggested code AS IS.
4. Each element in the returned list is a COMPLETE code snippet.
5. MUST be a valid JSON format. DO NOT be lazy!
6. Only return the new code to be inserted. DON NOT be lazy!
7. Please strictly check the code around the position and ensure that the complete code after insertion is correct. DO NOT be lazy!
8. Do not return the entire file content or any surrounding code.
9. Do not include any explanations, comments, or line numbers in your response.
10. Ensure the suggested code fits seamlessly with the existing code structure and indentation.