You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi I tried to create my own custom completion plugin for cmp,
it seems CMP loads it as I can see it in CmpStatus but on every keypress I get this error:
Any ideas? Thanks
Error detected while processing TextChangedI Autocommands for "*":
Error executing lua callback: .../.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/cache.lua:15: invalid value (table) at index 2 in table for 'concat'
stack traceback:
[C]: in function 'key'
.../.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/cache.lua:15: in function 'get'
.../.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/cache.lua:36: in function 'get_offset'
...s/stm/.local/share/nvim/lazy/nvim-cmp/lua/cmp/source.lua:270: in function 'complete'
/Users/stm/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:299: in function 'complete'
/Users/stm/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:169: in function 'callback'
/Users/stm/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:229: in function 'autoindent'
/Users/stm/.local/share/nvim/lazy/nvim-cmp/lua/cmp/core.lua:161: in function 'on_change'
/Users/stm/.local/share/nvim/lazy/nvim-cmp/lua/cmp/init.lua:338: in function 'callback'
...local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/autocmd.lua:49: in function 'emit'
...local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/autocmd.lua:23: in function <...local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/autocmd.lua:22>
Error detected while processing TextChangedI Autocommands for "*":
my plugin below
local M = {}
local source = {}
function source:is_available()
return true
end
function source:get_debug_name()
return "i8n"
end
function source:get_keyword_pattern()
return { "t(" }
end
function source:get_trigger_characters()
return { "'" }
end
local trans_table = {
{ label = "SomeThingHere" },
{ label = "AnotherThingHere" },
}
function source:complete(_, callback)
print("in complete")
callback({ items = trans_table })
end
function source:resolve(completion, callback)
callback(completion)
end
function source:execute(completion, callback)
callback(completion)
end
M.setup = function()
require("cmp").register_source("i8n", source)
end
return M
The text was updated successfully, but these errors were encountered:
Hi I tried to create my own custom completion plugin for cmp,
it seems CMP loads it as I can see it in CmpStatus but on every keypress I get this error:
Any ideas? Thanks
my plugin below
The text was updated successfully, but these errors were encountered: