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 Medeski
2024-11-07 09:05:32 -06:00
committed by GitHub
parent 81a4f3f690
commit a86c25286b

View File

@ -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",