From a874c2736ab10d45c0df3072f8481301f4404f33 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 15 Jan 2025 00:52:34 +0800 Subject: [PATCH] feat: refine suggestion prompts (#1082) --- lua/avante/templates/suggesting.avanterules | 25 ++++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lua/avante/templates/suggesting.avanterules b/lua/avante/templates/suggesting.avanterules index ca03d3f..602aad5 100644 --- a/lua/avante/templates/suggesting.avanterules +++ b/lua/avante/templates/suggesting.avanterules @@ -38,15 +38,18 @@ Your task is to suggest code modifications at the cursor position. Follow these Guidelines: 1. Make sure you have maintained the user's existing whitespace and indentation. This is REALLY IMPORTANT! - 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. DO 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. - 11. If there are no recommended modifications, return an empty list. - 12. Remember to ONLY RETURN the suggested code snippet, without any additional formatting or explanation. + 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. {% endblock %}