Closed rgruyters closed 10 months ago
same issue
Same issue
The commit you referenced is a one line change adding a nil check to opts to fix this problem.
Can one of you post your config? I'm using no arguments to the setup function and can't reproduce this.
What I can do I guess is just make a new local var instead of reassigning the parameter in case it's a luajit thing, but I really don't know why this would be happening.
for reference, I'm on master, and this works fine:
{
"zbirenbaum/copilot-cmp",
config = function ()
require("copilot_cmp").setup(nil)
end,
},
The commit you referenced is a one line change adding a nil check to opts to fix this problem.
Can one of you post your config? I'm using no arguments to the setup function and can't reproduce this.
What I can do I guess is just make a new local var instead of reassigning the parameter in case it's a luajit thing, but I really don't know why this would be happening.
for reference, I'm on master, and this works fine:
{ "zbirenbaum/copilot-cmp", config = function () require("copilot_cmp").setup(nil) end, },
I have the same issue, here is my config about copilot-cmp:
return {
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
build = ":Copilot auth",
module = "copilot",
opts = {
suggestion = { enabled = false },
panel = { enabled = false },
filetypes = {
yaml = false,
markdown = false,
help = false,
gitcommit = false,
gitrebase = false,
hgcommit = false,
svn = false,
cvs = false,
},
},
},
{
"zbirenbaum/copilot-cmp",
dependencies = "copilot.lua",
event = { "InsertEnter", "LspAttach" },
fix_pairs = true,
config = function(_, opts)
local copilot_cmp = require("copilot_cmp")
copilot_cmp.setup(opts)
-- attach cmp source whenever copilot attaches
-- fixes lazy-loading issues with the copilot cmp source
require("lazyvim.util").on_attach(function(client)
if client.name == "copilot" then
copilot_cmp._on_insert_enter({})
end
end)
end,
},
}
Btw, this config is based on LazyVim.
I'm wondering if the 'opts' the stack trace is referring to is actually the one in your config function. Could you try setting your config to be identical to mine? Just call the setup function with no args
Sorry for the delay, missed your question apparently. Anyway here is my copilot config
I noticed the issue gets triggered when you open a file and Copilot gets enabled in the background, but if do something quickly in between time, it triggers the error. (e.g. open Git status via tpope fugitive plugin or open Telescope window)
I can't reproduce this and most users don't have the issue. If it is still a problem please change your plugin startup order to initialize copilot-cmp earlier or later and that should fix the issue.
Since commit ad4c097bf76c544fce95a2cb6b02f245cb18a6bb I get a trace callback message when opening a file.
I'm using Neovim version 0.9.0 and nvim-cmp (commit) version
3ac8d6c