]> Sergey Matveev's repositories - vim-lsp.git/commitdiff
Invoke the LspDiagsUpdated user-autocmd after the diags are updated
authorYegappan Lakshmanan <yegappan@yahoo.com>
Thu, 27 Oct 2022 14:44:04 +0000 (07:44 -0700)
committerYegappan Lakshmanan <yegappan@yahoo.com>
Thu, 27 Oct 2022 14:44:04 +0000 (07:44 -0700)
autoload/lsp/diag.vim
doc/lsp.txt

index bd26515ebdf751a44a566f4745558c9dfd112f24..7be31eb7271cd4de8224f3519bb074e31d9f129c 100644 (file)
@@ -103,6 +103,11 @@ export def DiagNotification(lspserver: dict<any>, uri: string, diags: list<dict<
 
   lspserver.diagsMap->extend({[$'{bnr}']: diag_by_lnum})
   ProcessNewDiags(lspserver, bnr)
+
+  # Notify user scripts that diags has been updated
+  if exists('#User#LspDiagsUpdated')
+    doautocmd <nomodeline> User LspDiagsUpdated
+  endif
 enddef
 
 # get the count of error in the current buffer
index d885cc02a72ff28dc328687829d173d5edfdafb0..c8379644a9181432f1e1e7493bf4b50c018236c5 100644 (file)
@@ -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: