From b0334fd57cdb920e03afab3c1940114ad43e4fbe Mon Sep 17 00:00:00 2001 From: Tomas Slusny Date: Sat, 1 Mar 2025 15:21:12 +0100 Subject: [PATCH 1/2] fix(copilot-chat): switch from deprecated picker integrations (#5707) - Instead of using picker integrations (that are now deprecated), switch to using CopilotChat.select_prompt() that is using `vim.ui.select` which brings the selector integration responsibility to pickers instead of plugin - Use vim.ui.input instead of vim.fn.input for consistency Reason why this was deprecated in CopilotChat.nvim (by me) and will be removed in future is because these integrations never made any sense anyway when `vim.ui.select` overrides exist. ## Screenshots Using fzf-lua in my config, outside of LazyNvim but same thing applies: ![image](https://github.com/user-attachments/assets/a5171ffe-63a6-4b79-9925-fd8bef52e52f) ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. Signed-off-by: Tomas Slusny --- .../plugins/extras/ai/copilot-chat.lua | 46 ++++++------------- 1 file changed, 15 insertions(+), 31 deletions(-) diff --git a/lua/lazyvim/plugins/extras/ai/copilot-chat.lua b/lua/lazyvim/plugins/extras/ai/copilot-chat.lua index d67da7b2..58169b1e 100644 --- a/lua/lazyvim/plugins/extras/ai/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/ai/copilot-chat.lua @@ -1,28 +1,3 @@ -local M = {} - ----@param kind string -function M.pick(kind) - return function() - local actions = require("CopilotChat.actions") - local items = actions[kind .. "_actions"]() - if not items then - LazyVim.warn("No " .. kind .. " found on the current line") - return - end - local map = { - telescope = "telescope", - fzf = "fzflua", - snacks = "snacks", - } - for _, def in pairs(LazyVim.config.get_defaults()) do - if def.enabled and map[def.name] then - return require("CopilotChat.integrations." .. map[def.name]).pick(items) - end - end - Snacks.notify.error("No picker found") - end -end - return { { "CopilotC-Nvim/CopilotChat.nvim", @@ -62,16 +37,25 @@ return { { "aq", function() - local input = vim.fn.input("Quick Chat: ") - if input ~= "" then - require("CopilotChat").ask(input) - end + vim.ui.input({ + prompt = "Quick Chat: ", + }, function(input) + if input ~= "" then + require("CopilotChat").ask(input) + end + end) end, desc = "Quick Chat (CopilotChat)", mode = { "n", "v" }, }, - -- Show prompts actions with telescope - { "ap", M.pick("prompt"), desc = "Prompt Actions (CopilotChat)", mode = { "n", "v" } }, + { + "ap", + function() + require("CopilotChat").select_prompt() + end, + desc = "Prompt Actions (CopilotChat)", + mode = { "n", "v" }, + }, }, config = function(_, opts) local chat = require("CopilotChat") From ec5981dfb1222c3bf246d9bcaa713d5cfa486fbd Mon Sep 17 00:00:00 2001 From: folke <292349+folke@users.noreply.github.com> Date: Sat, 1 Mar 2025 14:22:16 +0000 Subject: [PATCH 2/2] chore(build): auto-generate docs --- doc/LazyVim.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/LazyVim.txt b/doc/LazyVim.txt index 881984e8..b5d95b12 100644 --- a/doc/LazyVim.txt +++ b/doc/LazyVim.txt @@ -1,4 +1,4 @@ -*LazyVim.txt* For Neovim Last change: 2025 February 22 +*LazyVim.txt* For Neovim Last change: 2025 March 01 ============================================================================== Table of Contents *LazyVim-table-of-contents*