From 35acffad9abfd6092f1a299cf53bdbd91203ff57 Mon Sep 17 00:00:00 2001 From: yetone Date: Sun, 31 Aug 2025 16:24:20 +0800 Subject: [PATCH] feat: support selected code prompt for ACP (#2657) --- lua/avante/llm.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lua/avante/llm.lua b/lua/avante/llm.lua index c2eb752..a88d68c 100644 --- a/lua/avante/llm.lua +++ b/lua/avante/llm.lua @@ -1114,6 +1114,17 @@ function M._stream_acp(opts) end end end + if opts.selected_code then + local prompt_item = { + type = "text", + text = string.format( + "\n%s\n%s\n", + opts.selected_code.path, + opts.selected_code.content + ), + } + table.insert(prompt, prompt_item) + end acp_client:send_prompt(session_id, prompt, function(_, err_) if err_ then opts.on_stop({ reason = "error", error = err_ })