Skip to content

Commit

Permalink
fix: refine suggestion prompts
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone committed Jan 15, 2025
1 parent a874c27 commit 79523cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lua/avante/suggestion.lua
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ function Suggestion:show()

local suggestions = ctx.suggestions_list and ctx.suggestions_list[ctx.current_suggestions_idx] or nil

Utils.debug("show suggestions", suggestions)

if not suggestions then return end

for _, suggestion in ipairs(suggestions) do
Expand Down
5 changes: 3 additions & 2 deletions lua/avante/templates/suggesting.avanterules
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Your task is to suggest code modifications at the cursor position. Follow these
{% 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
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:
Expand All @@ -52,4 +52,5 @@ Guidelines:
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 %}

0 comments on commit 79523cb

Please sign in to comment.