Closed luxus closed 1 year ago
i don't use copilot.lua,but i think we might need to move a couple of things around since lunarvim has done some stuff to make cmp+copilot integration easier
diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua
index f569399..0c7ebde 100644
--- a/lua/user/plugins.lua
+++ b/lua/user/plugins.lua
@@ -387,17 +387,25 @@ M.config = function()
},
{
"zbirenbaum/copilot.lua",
- after = "nvim-cmp",
- requires = { "zbirenbaum/copilot-cmp" },
+ event = { "VimEnter" },
config = function()
- local cmp_source = { name = "copilot", group_index = 2 }
- table.insert(lvim.builtin.cmp.sources, cmp_source)
vim.defer_fn(function()
- require("copilot").setup()
+ require("copilot").setup {
+ plugin_manager_path = os.getenv "LUNARVIM_RUNTIME_DIR" .. "/site/pack/packer",
+ }
end, 100)
end,
disable = not lvim.builtin.sell_your_soul_to_devil.prada,
},
+
+ {
+ "zbirenbaum/copilot-cmp",
+ after = { "copilot.lua" },
+ config = function()
+ require("copilot_cmp").setup()
+ end,
+ disable = not lvim.builtin.sell_your_soul_to_devil.prada,
+ },
{
"ThePrimeagen/harpoon",
requires = {
something like this... i just copied some stuff around :D
and added this
lvim.builtin.cmp.formatting.source_names["copilot"] = "(Copilot)"
table.insert(lvim.builtin.cmp.sources, 1, { name = "copilot" })
to the config
but it stills not really works.. really strange :(
I'd check the lsp logs. I initially set up zbirenbaum/copilot-cmp and it worked for a while but at some point it stopped working. I switched back to tpope's version and it threw more explicit error messages about my version of node. At the time I think it only worked with version 12 of node. So I downgraded node and got it working.
I probably didn't need to switch plugins, just downgrade my node version.
lmao ignore all of this. leaving up for posterity. no issue with config. github's copilot API was just down/degraded last night
Going to continue debugging, just wanted to log what I'm seeing so far. Was working for me for until today
Re-authorizing on account with active Copilot access:
Re-starting lvim, unauthorized again:
[packer.nvim] [ERROR 20:07:46] async.lua:20: Error in coroutine: ...ack/packer/start/packer.nvim/lua/packer/plugin_utils.lua:204: Vim(elseif):E716: Key not present in Diction
ary: "rhs !~# 'copilot'"
enable prada & reload config ->
[copilot] config is already set
Error executing vim.schedule lua callback: .../site/pack/packer/opt/copilot.lua/lua/copilot/client.lua:47: attempt to index local 'params' (a nil value)
stack traceback:
.../site/pack/packer/opt/copilot.lua/lua/copilot/client.lua:47: in function 'merge_server_opts'
.../site/pack/packer/opt/copilot.lua/lua/copilot/client.lua:75: in function 'start'
...im/site/pack/packer/opt/copilot.lua/lua/copilot/init.lua:37: in function <...im/site/pack/packer/opt/copilot.lua/lua/copilot/init.lua:36>
copilot.vim works fine, cannot reproduce
after some modifications I got even cmp working.
cmp variant is not stable or working correctly for me. does anyone else have luck with it?
shrug
i tried the lua version with cmp of copilot, but i struggle to get it working .. i got the message Copilot is not running. when i enter :Copilot auth (i opened a py file) the normal tpope version works fine