elixir-tools / elixir-tools.nvim

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

CodeLens refresh error on neovim 0.10.0 #211

Closed jc00ke closed 1 month ago

jc00ke commented 1 month ago

https://github.com/elixir-tools/elixir-tools.nvim/blob/51eddb03a7a8c9f00d6415b356a4d3b75d8e75b6/lua/elixir/elixirls/init.lua#L196-L200

When those lines are uncommented, I see the following error:

Error detected while processing CursorHold Autocommands for "<buffer=8>":
method textDocument/codeLens is not supported by any of the servers registered for the current buffer
buffer=8 LspInfo ``` Client: ElixirLS (id: 3, bufnr: [8]) filetypes: autostart: false root directory: /home/jesse/projects/foo cmd: /home/jesse/.cache/nvim/elixir-tools.nvim/installs/elixir-lsp/elixir-ls/tags_v0.21.1/1.16.2-26/language_server.sh ```

If I comment out 196-199 then I don't get:

Error detected while processing CursorHold Autocommands for "<buffer=8>":

If I comment out line 200 then I don't get:

method textDocument/codeLens is not supported by any of the servers registered for the current buffer

I don't have the debug commands anymore, but I did see earlier this week that the client does support textDocument/codeLens or at least that's what I remember.

Anyway, not sure of a possible fix, I just know that in order to use neovim 0.10.0 I need to comment out those 5 lines.

mhanberg commented 1 month ago

I saw a similar thing with rust analyzer and I think yaml language server earlier.

I think it has to do with passing the function value as the callback rather than calling it inside an anonymous function.

I'll push a fix once I get back to the computer

mhanberg commented 1 month ago

@jc00ke I just publisehd 0.14.1, please update and check if it works.

jc00ke commented 1 month ago

I just updated and I still see the error.

Error detected while processing CursorHold Autocommands for "<buffer=4>":
method textDocument/codeLens is not supported by any of the servers registered for the current buffer
:autocmd CursorHold
--- Autocommands ---
CursorHold
    <buffer=4>
              <Lua 109: ~/.local/share/nvim/lazy/elixir-tools.nvim/lua/elixir/elixirls/init.lua:198>
mhanberg commented 1 month ago

Okay, I think i actually figured it out now, will push one more change

mhanberg commented 1 month ago

Okay, update to 0.14.2 and try once more

jc00ke commented 1 month ago

Rad, I don't see the errors anymore! Thank you!

mxgrn commented 1 month ago

I'm on 0.14.2, getting the same error in Neovim when editing an .exs file:

Error detected while processing CursorHold Autocommands for "<buffer=1>":
method textDocument/codeLens is not supported by any of the servers registered for the current buffer
mhanberg commented 1 month ago

I just updated and I still see the error.


Error detected while processing CursorHold Autocommands for "<buffer=4>":

method textDocument/codeLens is not supported by any of the servers registered for the current buffer

:autocmd CursorHold

--- Autocommands ---

CursorHold

    <buffer=4>

              <Lua 109: ~/.local/share/nvim/lazy/elixir-tools.nvim/lua/elixir/elixirls/init.lua:198>

@mxgrn Can you check the location of that autocmd like he did above?

mxgrn commented 1 month ago

Looks like WakaTime plugin interferes:

:autocmd CursorHold
--- Autocommands ---
Wakatime  CursorHold
    *         call s:HandleActivity(s:false)
mxgrn commented 1 month ago

Looks like WakaTime plugin interferes:

:autocmd CursorHold
--- Autocommands ---
Wakatime  CursorHold
    *         call s:HandleActivity(s:false)