Neovim-from-scratch icon indicating copy to clipboard operation
Neovim-from-scratch copied to clipboard

lsp error with on_attach.

Open Neragin opened this issue 2 years ago • 1 comments

The error I received was:

Error detected while processing /home/xxx/.config/nvim/init.lua:
E5113: Error while calling lua chunk: /home/xxx/.config/nvim/lua/user/lsp/configs.lua:16: attempt to index a boole
an value
stack traceback:
        /home/xxx/.config/nvim/lua/user/lsp/configs.lua:16: in main chunk
        [C]: in function 'require'
        /home/xxx/.config/nvim/lua/user/lsp/init.lua:6: in main chunk
        [C]: in function 'require'
        /home/xxx/.config/nvim/init.lua:6: in main chunk

line 16 for me is

on_attach = require("user.lsp.handlers").on_attach,

Is there anything I can do to figure out more about this error?

Neragin avatar Jun 06 '22 19:06 Neragin

Do you have cmp and the lsp source for cmp installed?

If you take a look at handlers.lua:93: It will just return nil if you don't have cmp_nvim_lsp installed, which will cause the issue in configs.lua:16.

For me this issue went away after installing cmp and its lsp source.

3n3l avatar Jun 10 '22 13:06 3n3l