Closed MariaSolOs closed 12 months ago
Why is the error message appearing in floating window? Is lspsaga creating it?
No, the error is coming from Noice.
Anyway, I found the issue after debugging for a while. Turns out that Lspsaga creates a buffer for displaying diagnostics that has a filetype of 'markdown'. That wakes up the Markdown language server, and my attach
callback then attaches that server to that unnamed markdown buffer that's displaying the diagnostics. When navigating through the diagnostic windows, those buffers are closed and then navic
freaks out because there's a client that's not attached to the current buffer...
Modifying my attach callback to have the following check fixes the issue, although I'm unsure if it's the right fix.
if buf_client.server_capabilities.documentSymbolProvider and vim.api.nvim_buf_get_name(bufnr) ~= '' then
require('nvim-navic').attach(buf_client, bufnr)
end
Oh ok! I see what is happening. nvim-navic is trying to poll the lsp server, but since the buffer is closed before the lsp server has a chance to respond, it is causing the error.
The modification to the attach function isn't the right fix. Can you try out the request_loop_fix
branch and tell me if the error is fixed for you?
@SmiteshP It fixed it!
Awesome 🚀
Hello! I just installed this plugin but I'm getting the following errors when navigating through diagnostics with Lspsaga (this happens after using
Lspsaga diagnostic_jump_prev/next
):Any help is appreciated 🙏🏻