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 <folke.lemaitre@gmail.com>
This commit is contained in:
Josh MedeskiandFolke Lemaitre authored and GitHub committed 2024-11-07 16:05:32 +01:00
1 parent 81a4f3f690
commit a86c25286b
1 file changed
+3 -1
@@ -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",