benlubas / cmp2lsp

use nvim-cmp sources as if they were native LSP sources (mostly)
35 stars 1 forks source link

Supermaven error #3

Closed Bleksak closed 2 weeks ago

Bleksak commented 2 weeks ago

This is the error message that I'm getting:

Error detected while processing /home/bleksak/.config/nvim/init.lua:
E5113: Error while calling lua chunk: vim/shared.lua:0: Cannot deepcopy object of type userdata
stack traceback:
        [C]: in function 'error'
        vim/shared.lua: in function ''
        vim/shared.lua: in function 'deepcopy'
        ...ak/.config/nvim/pack/nvim/start/cmp2lsp/lua/cmp/init.lua:78: in function 'register_source'
        .../nvim/start/supermaven-nvim/lua/supermaven-nvim/init.lua:46: in function 'setup'
        /home/bleksak/.config/nvim/lua/plug/codeium.lua:17: in main chunk
        [C]: in function 'require'
        /home/bleksak/.config/nvim/init.lua:35: in main chunk
Press ENTER or type command to continue

It comes from this piece of code in supermaven:

function source.new(client, opts)
  local self = setmetatable({
    timer = loop.new_timer(),
  }, { __index = source })

  self.client = client

  return self
end

If this line is deleted, the error is gone:

timer = loop.new_timer(),
benlubas commented 2 weeks ago

I wonder if the deepcopy in my code is even necessary... It came with the code I took from care. I'll comment it out, and just take note of it.

benlubas commented 2 weeks ago

fixed with the latest commit. Hopefully that doesn't silently break something down the road