autoload/lsp/diag.vim | 5 +++++ doc/lsp.txt | 6 ++++++ diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index bd26515ebdf751a44a566f4745558c9dfd112f24..7be31eb7271cd4de8224f3519bb074e31d9f129c 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -103,6 +103,11 @@ endfor lspserver.diagsMap->extend({[$'{bnr}']: diag_by_lnum}) ProcessNewDiags(lspserver, bnr) + + # Notify user scripts that diags has been updated + if exists('#User#LspDiagsUpdated') + doautocmd User LspDiagsUpdated + endif enddef # get the count of error in the current buffer diff --git a/doc/lsp.txt b/doc/lsp.txt index d885cc02a72ff28dc328687829d173d5edfdafb0..c8379644a9181432f1e1e7493bf4b50c018236c5 100644 --- a/doc/lsp.txt +++ b/doc/lsp.txt @@ -705,4 +705,10 @@ LspAttached A |User| autocommand fired when the LSP client attaches to a buffer. Can be used to configure buffer-local mappings or options. + *LspDiagsUpdated* +LspDiagsUpdated A |User| autocommand invoked when new + diagnostics are received from the language + server. This is invoked after the LSP client + has processed the diagnostics. + vim:tw=78:ts=8:noet:ft=help:norl: