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
local cmp= require 'cmp'
local luasnip = require 'luasnip'require('luasnip.loaders.from_vscode').lazy_load()
luasnip.config.setup {}
cmp.setup {
performance = {
max_view_entries =7,
fetchin_timeout =1000,
},
snippet = {
expand=function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping=cmp.mapping.preset.insert {
['<C-n>'] =cmp.mapping.select_next_item(),
['<C-p>'] =cmp.mapping.select_prev_item(),
['<C-u>'] =cmp.mapping.scroll_docs(-4),
['<C-d>'] =cmp.mapping.scroll_docs(4),
['<C-Space>'] =cmp.mapping.complete {},
['<C-e>'] =cmp.mapping.abort(),
['<CR>'] =cmp.mapping.confirm {
behavior =cmp.ConfirmBehavior.Replace,
-- select first item ifnone selected
select = true,
},
['<Tab>'] =cmp.mapping(function(fallback)
ifcmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
elsefallback()
endend, { 'i', 's' }),
},
sources =cmp.config.sources({
{ name ='nvim_lsp' },
{ name ='luasnip' },
}, {
{
name ='buffer',
options= {
get_bufnrs =function()
local buf=vim.api.nvim_get_current_buf()
local byte_size =vim.api.nvim_buf_get_offset(buf, vim.api.nvim_buf_line_count(buf))
if byte_size > 1024*1024 then --1 Megabyte maxreturn {}
endreturn { buf }
end
}
},
}),
view= {
docs = true
}
}
Description
whenever i enter a new go file to start coding i get an error, the error is reproduced with every keystroke.
Steps to reproduce
using neovim 0.10.0
using mason with lsp: golsp
the error should appear as soon as you start typing.
Expected behavior
nvim-cmp shows list of compeletion
Actual behavior
i get the follow error
Error executing vim.schedule lua callback: ...[user]/.local/share/nvim/lazy/nvim-cmp/lua/cmp/view.lua:291: attempt to index field 'docs' (a boolean va
lue)
stack traceback:
...[user]/.local/share/nvim/lazy/nvim-cmp/lua/cmp/view.lua:291: in function 'callback'
...[user]/.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/async.lua:138: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Additional context
No response
The text was updated successfully, but these errors were encountered:
FAQ
Announcement
Minimal reproducible full config
Description
whenever i enter a new go file to start coding i get an error, the error is reproduced with every keystroke.
Steps to reproduce
using neovim 0.10.0
using mason with lsp: golsp
the error should appear as soon as you start typing.
Expected behavior
nvim-cmp shows list of compeletion
Actual behavior
i get the follow error
Error executing vim.schedule lua callback: ...[user]/.local/share/nvim/lazy/nvim-cmp/lua/cmp/view.lua:291: attempt to index field 'docs' (a boolean va
lue)
stack traceback:
...[user]/.local/share/nvim/lazy/nvim-cmp/lua/cmp/view.lua:291: in function 'callback'
...[user]/.local/share/nvim/lazy/nvim-cmp/lua/cmp/utils/async.lua:138: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Additional context
No response
The text was updated successfully, but these errors were encountered: