From 23efc7394975eb2a0a1d74a7b58d230876889893 Mon Sep 17 00:00:00 2001 From: Yegappan Lakshmanan Date: Thu, 27 Oct 2022 07:44:04 -0700 Subject: [PATCH] Invoke the LspDiagsUpdated user-autocmd after the diags are updated --- autoload/lsp/diag.vim | 5 +++++ doc/lsp.txt | 6 ++++++ 2 files changed, 11 insertions(+) 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: -- 2.48.1