ntk148v / neovim-config

A minimal neovim configuration written in Lua
Apache License 2.0
148 stars 60 forks source link

Occasional lspconfig error #11

Closed cabreraam closed 2 days ago

cabreraam commented 3 days ago

Hi @ntk148v! Thanks for this amazing template

I've just tried to use this on my Apple M1 based machine, having installed nvim v0.10.2 via homebrew.

I'm new to neovim and lua, so I'm don't quite understand the syntax, but I occasionally (read: not always) get the follwoing error:

Error detected while processing VimEnter Autocommands for "*":
~/.config/nvim/lua/plugins/configs/lspconfig.lua:72: attempt to call field 'setup' (a nil value)

Any idea what this means/what might be causing this? Here's the offending line from the error above in the codebase.

Thanks! Anthony

ntk148v commented 3 days ago

Hi @cabreraam, could you provide the result of command :messages? and make sure you've updated the newest commits.

cabreraam commented 3 days ago

Here is the output of :messages (which doesn't add anything unfortunately):

:messages
Error detected while processing VimEnter Autocommands for "*":
~/.config/nvim/lua/plugins/configs/lspconfig.lua:72: attempt to call field 'setup' (a nil value)

I am using the most recent commit of your project (69d3b9b1146075c5ccab84adb88975a8408330ab)

cabreraam commented 3 days ago

With some print debugging, I think the issue might be with ruff_lsp.

when I wrap the problem line with print statements before and after, I get the following output:

hello ruff
goodbye ruff
hello yamlls
goodbye yamlls
hello vimls
goodbye vimls
hello gopls
goodbye gopls
hello dockerls
goodbye dockerls
hello bashls
goodbye bashls
hello ruff_lsp
Error detected while processing VimEnter Autocommands for "*":
/Users/amc/.config/nvim/lua/plugins/configs/lspconfig.lua:73: attempt to call field 'setup' (a nil value)
hello jsonls
goodbye jsonls
hello cmake
goodbye cmake

But the interesting thing is that sometimes nothing fails:

hello gopls
goodbye gopls
hello yamlls
goodbye yamlls
hello cmake
goodbye cmake
hello vimls
goodbye vimls
hello bashls
goodbye bashls
hello ruff_lsp
goodbye ruff_lsp
hello jsonls
goodbye jsonls
hello dockerls
goodbye dockerls
hello ruff
goodbye ruff
cabreraam commented 2 days ago

I think I was able to trace the issue back to a local ruff-lsp installation issue. I've removed ruff-lsp and reinstalled it and that seemed to fix my issue.