mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
fix(lsp): persist diagnostic config for clients
Persist configuration settings set with `vim.lsp.with` and `vim.lsp.diagnostic.on_publish_diagnostics` by setting the config for the namespace associated with the client.
This commit is contained in:
parent
389a898586
commit
bcc9ba51fa
@ -211,9 +211,14 @@ function M.on_publish_diagnostics(_, result, ctx, config)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Persist configuration to ensure buffer reloads use the same
|
||||
-- configuration. To make lsp.with configuration work (See :help
|
||||
-- lsp-handler-configuration)
|
||||
vim.diagnostic.config(config, namespace)
|
||||
end
|
||||
|
||||
vim.diagnostic.set(namespace, bufnr, diagnostic_lsp_to_vim(diagnostics, bufnr, client_id), config)
|
||||
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")
|
||||
|
Loading…
Reference in New Issue
Block a user