From a86c25286b83d766af8935db31417c0ce417b865 Mon Sep 17 00:00:00 2001 From: Josh Medeski Date: Thu, 7 Nov 2024 09:05:32 -0600 Subject: [PATCH] fix(copilot-chat): setup cmp conditionally (#4716) ## Description Check for cmp before setting up copilot chat. ## Related Issue(s) For https://github.com/LazyVim/LazyVim/issues/4702 I would like to set up the cmp compatability later if possible, but this is a quick patch to allow copilot chat to work without cmp (for now). ## Checklist - [x] I've read the [CONTRIBUTING](https://github.com/LazyVim/LazyVim/blob/main/CONTRIBUTING.md) guidelines. --------- Co-authored-by: Folke Lemaitre --- lua/lazyvim/plugins/extras/coding/copilot-chat.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua index fd58b857..042ab8ff 100644 --- a/lua/lazyvim/plugins/extras/coding/copilot-chat.lua +++ b/lua/lazyvim/plugins/extras/coding/copilot-chat.lua @@ -73,7 +73,9 @@ return { }, config = function(_, opts) local chat = require("CopilotChat") - require("CopilotChat.integrations.cmp").setup() + if pcall(require, "cmp") then + require("CopilotChat.integrations.cmp").setup() + end vim.api.nvim_create_autocmd("BufEnter", { pattern = "copilot-chat",