feat(diagnostic)!: make DiagnosticChanged a first class autocmd (#16098)

This allows users to hook into diagnostic events with finer granularity
(e.g. per-buffer or file).

BREAKING CHANGE: DiagnosticsChanged and LspDiagnosticsChanged user
autocommands are removed.
This commit is contained in:
Gregory Anders
2021-11-25 11:55:11 -07:00
committed by GitHub
parent 1a60580925
commit 150a5922aa
4 changed files with 12 additions and 9 deletions

View File

@ -220,9 +220,6 @@ function M.on_publish_diagnostics(_, result, ctx, config)
end
vim.diagnostic.set(namespace, bufnr, diagnostic_lsp_to_vim(diagnostics, bufnr, client_id))
-- Keep old autocmd for back compat. This should eventually be removed.
vim.api.nvim_command("doautocmd <nomodeline> User LspDiagnosticsChanged")
end
--- Clear diagnotics and diagnostic cache.