Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refine suggestion prompts #1087

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 %}
Loading