From: Yegappan Lakshmanan Date: Thu, 27 Oct 2022 14:44:04 +0000 (-0700) Subject: Invoke the LspDiagsUpdated user-autocmd after the diags are updated X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=23efc7394975eb2a0a1d74a7b58d230876889893;p=vim-lsp.git Invoke the LspDiagsUpdated user-autocmd after the diags are updated --- diff --git a/autoload/lsp/diag.vim b/autoload/lsp/diag.vim index bd26515..7be31eb 100644 --- a/autoload/lsp/diag.vim +++ b/autoload/lsp/diag.vim @@ -103,6 +103,11 @@ export def DiagNotification(lspserver: dict, uri: string, diags: listextend({[$'{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 d885cc0..c837964 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: