LunarVim / Neovim-from-scratch

📚 A Neovim config designed from scratch to be understandable
https://www.chrisatmachine.com/
GNU General Public License v3.0
5.4k stars 1.17k forks source link

nvim-cmp and its extension issues #271

Open tiankaixie opened 1 year ago

tiankaixie commented 1 year ago

Hello,

I am using neovim 0.8.1, and I am following branch 05-completion to set up my nvim-cmp. I exactly copied plugins.lua and cmp.lua, but I got this error:

               Error detected while processing /Users/tiankaixie/.local/share/nvim/site/pack/packer/start/cmp-buffer/after/plugin/cmp_buffer.lua:
E5113: Error while calling lua chunk: ...pack/packer/start/cmp-buffer/after/plugin/cmp_buffer.lua:1: attempt to index a boolean value
stack traceback:
        ...pack/packer/start/cmp-buffer/after/plugin/cmp_buffer.lua:1: in main chunk
Error detected while processing /Users/tiankaixie/.local/share/nvim/site/pack/packer/start/cmp-nvim-lua/after/plugin/cmp_nvim_lua.lua:
E5113: Error while calling lua chunk: .../packer/start/cmp-nvim-lua/after/plugin/cmp_nvim_lua.lua:1: attempt to index a boolean value
stack traceback:
        .../packer/start/cmp-nvim-lua/after/plugin/cmp_nvim_lua.lua:1: in main chunk
Error detected while processing /Users/tiankaixie/.local/share/nvim/site/pack/packer/start/cmp-path/after/plugin/cmp_path.lua:
E5113: Error while calling lua chunk: ...ite/pack/packer/start/cmp-path/after/plugin/cmp_path.lua:1: attempt to index a boolean value
stack traceback:
        ...ite/pack/packer/start/cmp-path/after/plugin/cmp_path.lua:1: in main chunk
Error detected while processing /Users/tiankaixie/.local/share/nvim/site/pack/packer/start/cmp_luasnip/after/plugin/cmp_luasnip.lua:
E5113: Error while calling lua chunk: ...ck/packer/start/cmp_luasnip/after/plugin/cmp_luasnip.lua:1: attempt to index a boolean value
stack traceback:
        ...ck/packer/start/cmp_luasnip/after/plugin/cmp_luasnip.lua:1: in main chunk
Press ENTER or type command to continue

I suspect this is some version issue of those plugins, or nvim-cmp. Is anyone facing the same issue here? Thanks.

0-th commented 1 year ago

Following Chris' tutorial as well. Copied from the same branch. Neovim 0.8.1. No issues. After displaying the error does the completion feature work?

imzaynb commented 1 year ago

Hey there!

I was able to resolve this issue by renaming cmp.lua --> <something else>.lua and changing the proper line in init.lua as apparently one of the plugins has a requirement or something of the same name.

See this for more info: https://github.com/hrsh7th/nvim-cmp/issues/1063.

0-th commented 1 year ago

Oh! That's cool.