elixir-tools / elixir-tools.nvim

Neovim plugin for Elixir
MIT License
398 stars 29 forks source link

Attempt to index field 'capabilities' (a nil value) in nvim #148

Closed treshenry closed 12 months ago

treshenry commented 12 months ago

Heya! Got a weird one which may, or may not, actually be NextLS. I just started getting the following error when opening .ex files for the first time in an nvim session:

LSP[NextLS]: Error SERVER_REQUEST_HANDLER_ERROR: "...bIFYr/usr/share/nvim/runtime/lua/vim/lsp/_watchfiles.lua:199: attempt to index field 'capabilities' (a nil value)"

I'm not sure if this is coming from actual code in the repo (the only references to capabilities I can find are in Phoenix' live_dashboard code) or if this is some combination of tools/config causing an issue.

I'm happy to provide more detail/logs/whatever if someone points me in the right direction. This happens consistently on startup now, so it's an easy repro for me.

Ubuntu 22.04.2 LTS NVIM v0.9.1 I'm using AstroNvim and my config is here: https://github.com/treshenry/astronvim_config/ particularly https://github.com/treshenry/astronvim_config/blob/main/plugins/elixir-tools.lua which is just a copy/paste from https://github.com/elixir-tools/elixir-tools.nvim 🤷‍♂️

mhanberg commented 12 months ago

That exception is from neovim itself, not Next LS or elixir-tools.nvim.

Let me try myself using neovim stable (I run nightly for the most part) to see if I can reproduce.

Also, can you confirm the versions of Next LS and elixir-tools.nvim you are using.

treshenry commented 12 months ago
$ pwd
/home/tres/.local/share/nvim/lazy/elixir-tools.nvim
$ cat version.txt
0.6.6

Does that help? It looks like lazy just checks out main, I'm guessing because the config specifies version: "*" (from the suggested config at https://github.com/elixir-tools/elixir-tools.nvim)

mhanberg commented 12 months ago

If you open :Lazy and then find the elixir-tools entry and then hit enter, you'll see something like this

CleanShot 2023-07-28 at 10 25 59@2x

NextLS should be on the latest version, but you can check by looking at the lsp log (or through my output-panel plugin

mhanberg commented 12 months ago

I replicated it on 0.9.1, might be something that was already fixed on nightly.

i'll try to see if i can fix in the plugin.

also i'm transferring this to the neovim plugin repo

mhanberg commented 12 months ago

Closed by 088bb2dd940586647aadaec30506654e0e69d1c4

treshenry commented 12 months ago

image

Just for posterity!

treshenry commented 12 months ago

Verified this is fixed in 0.7.1. Woot! 👏