On Neovim 0.10, this error is shown when exiting insert mode if multiple buffers, with LSP clients, are open and one doesn't support code lenses:
Error detected while processing InsertLeave Autocommands for "*.go":
method textDocument/codeLens is not supported by any of the servers registered for the current buffer
Neovim 0.10 changed vim.lsp.codelens.refresh to refresh all buffers. There's an open issue on the neovim github that has more information. go.nvim creates an autocmd that calls vim.lsp.codelens.refresh when exiting insert mode.
Passing { bufnr = 0 } to vim.lsp.codelens.refreshhere fixed the issue for me. A warning will still be printed when running a code lens since vim.lsp.codelens.run calls vim.lsp.codelens.refresh without passing the buffer, however, it won't take away focus and the code lens still runs.
On Neovim 0.10, this error is shown when exiting insert mode if multiple buffers, with LSP clients, are open and one doesn't support code lenses:
Neovim 0.10 changed
vim.lsp.codelens.refresh
to refresh all buffers. There's an open issue on the neovim github that has more information.go.nvim
creates an autocmd that callsvim.lsp.codelens.refresh
when exiting insert mode.Passing
{ bufnr = 0 }
tovim.lsp.codelens.refresh
here fixed the issue for me. A warning will still be printed when running a code lens sincevim.lsp.codelens.run
callsvim.lsp.codelens.refresh
without passing the buffer, however, it won't take away focus and the code lens still runs.