Closed Shatur closed 4 years ago
Since lsp-status
doesn't fetch new diagnostics itself (it just collects them using the built-in API), there's not a callback built in for this purpose. However, the native LSP client should trigger LspDiagnosticsChanged
(see :help LspDiagnosticsChanged
) when it receives new diagnostics; you can make an autocommand for this event to call your custom update code.
Feel free to reopen if that's not quite what you're after!
Thank you a lot!
autocmd User LspDiagnosticsChanged call lightline#update()
is just what I need.
Thank you a lot!
autocmd User LspDiagnosticsChanged call lightline#update()
is just what I need.
@Shatur95, it seems LspDiagnosticsChanged
event is not fired when the number of diagnostic information goes to 0 from non-zero. Is this true in your case?
Sorry, do not Neovim as IDE right now, only as a text editor.
Since
lsp-status
doesn't fetch new diagnostics itself (it just collects them using the built-in API), there's not a callback built in for this purpose. However, the native LSP client should triggerLspDiagnosticsChanged
(see:help LspDiagnosticsChanged
) when it receives new diagnostics; you can make an autocommand for this event to call your custom update code.Feel free to reopen if that's not quite what you're after!
@wbthomason I added the following autocmd to my vimrc for testing purpose:
autocmd User LspDiagnosticsChanged :echom "diagnostic changed"
it seems LspDiagnosticsChanged
is not triggered when number of diagnostics goes to zero. So my status line shows a non-zero number of diagnostics when it's actually zero.
How do I fix this?
@smartding: Unfortunately, that sounds like an issue to report to core Neovim - lsp-status
does not generate the LspDiagnosticsChanged
event, so I can't directly debug this issue.
@smartding: Unfortunately, that sounds like an issue to report to core Neovim -
lsp-status
does not generate theLspDiagnosticsChanged
event, so I can't directly debug this issue.
ok, thanks, I'll ask the neovim guys
@smartding I did it for you, having the same issue.
@smartding I did it for you, having the same issue.
oh, thanks. they have a really long issue template, never had the time to fill it out:)
LspDiagnosticsChanged
is finally working now that https://github.com/neovim/neovim/pull/13483 is merged
Thank for the awesome plugin!
I have a question. There is
diagnostics()
function that allows to get information about errors, warnings, hints, etc. Is there a way to get a callback when the diagnostics changes? For example, in lightline.vim I need to have a callback to display custom section by callingcall lightline#update()
.