From 0db3e5abaf18df1fc1518894efea902b9ecc15f0 Mon Sep 17 00:00:00 2001 From: "Adam K." Date: Tue, 11 Jun 2024 10:20:58 -0500 Subject: [PATCH] feat(copilot-chat): use fzf-lua if enabled in extras Adds the abiltiy for fzf-lua to be used as a picker for these copilot chat actions if it was enabled in LazyExtras --- .../plugins/extras/coding/copilot-chat.lua | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index 59f5bded..d7e33d15 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -100,6 +100,35 @@ return { }, }, + { + "ibhagwan/fzf-lua", + optional = true, + keys = { + -- Show help actions with fzf-lua (if installed in extras) + { + "ad", + function() + local actions = require("CopilotChat.actions") + local help = actions.help_actions() + if not help then + LazyVim.warn("No diagnostics found on the current line") + return + end + require("CopilotChat.integrations.fzflua").pick(help) + end, + desc = "Diagnostic Help (CopilotChat)", + }, + -- Show prompts actions with fzf-lua (if installed in extras) + { + "ap", + function() + local actions = require("CopilotChat.actions") + require("CopilotChat.integrations.fzflua").pick(actions.prompt_actions()) + end, + desc = "Prompt Actions (CopilotChat)", + }, + }, + }, -- Edgy integration { "folke/edgy.nvim",