ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
2.01k stars 56 forks source link

Error detected while processing CursorHold Autocommands #235

Closed the-c0d3r closed 1 year ago

the-c0d3r commented 1 year ago

Hi,

Is there a way to make the lsp_signature to not show up the error message every time a file with LSP that does not support CodeLens is loaded?

It always shows up the following error message when I load up files like yaml, json, or bash.

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
Press ENTER or type command to continue

And upon checking the autocmd, I see this.

:autocmd CursorHold
--- Autocommands ---
Signature  CursorHold
    <buffer=3>
              lua require'lsp_signature'.on_UpdateSignature()
              lua require'lsp_signature'.check_signature_should_close()
NGCodeActGroup_3  CursorHold
    <buffer=3>
              <Lua 454: ~/.local/share/nvim/site/pack/packer/opt/navigator.lua/lua/navigator/lspclient/attach.lua:76>
nv__codelenses  CursorHold
    <buffer=4>
              <Lua 1219: ~/.local/share/nvim/site/pack/packer/opt/navigator.lua/lua/navigator/codelens.lua:74>
Signature  CursorHold
    <buffer=4>
              lua require'lsp_signature'.on_UpdateSignature()
              lua require'lsp_signature'.check_signature_should_close()
Press ENTER or type command to continue

Is there a way to make it maybe check if the lsp server supports the required feature then silently quit if it doesn't? This is quite annoying as I have to edit a lot of json, yaml, and bash scripts day to day, and it keeps showing up every time I change buffer, or open new files of said extensions.

If I'm not wrong, both lsp_signature and navigator.lua has the same exact issue. I was forced to disable lsp_signature and I still see the error message one form or another, until I disable navigator.lua as well.

This is my LspInfo if it helps.

Use [q] or [Esc] to quit the window

 Language client log: ~/.local/state/nvim/lsp.log
 Detected filetype:   sh

 1 client(s) attached to this buffer: 

 Client: bashls (id: 5, pid: nil, bufnr: [4])
    filetypes:       sh
    autostart:       true
    root directory: ~/work/proj
    cmd:             bash-language-server start

 3 active client(s) not attached to this buffer: 

 Client: pyright (id: 2, pid: nil, bufnr: [3])
    filetypes:       python, python, python, python, python
    autostart:       true
    root directory:  Running in single file mode.
    cmd:             pyright-langserver --stdio

 Client: pylsp (id: 3, pid: nil, bufnr: [3])
    filetypes:       python
    autostart:       true
    root directory:  ~/work/proj
    cmd:             pylsp

 Client: pyright (id: 4, pid: nil, bufnr: [3])
    filetypes:       python
    autostart:       true
    root directory:  Running in single file mode.
    cmd:             pyright-langserver --stdio

 Configured servers list: pyright, clangd, sumneko_lua, html, bashls, ansiblels, dockerls, jsonls, luau_lsp, pylsp, cssls
ray-x commented 1 year ago

This is a bug in navigator.lua. I pushed a change for it.

the-c0d3r commented 1 year ago

@ray-x thank you so much for such a prompt fix.

Both of your plugins lsp_signature and navigator are extremely useful. Thank you for creating them.