mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 16:36:30 +00:00
fix(lsp): remove vim.lsp.diagnostic.reset()
(#35938)
This commit is contained in:
@@ -255,7 +255,6 @@ For each of the functions below, use the corresponding function in
|
|||||||
• *vim.lsp.diagnostic.goto_next()*
|
• *vim.lsp.diagnostic.goto_next()*
|
||||||
• *vim.lsp.diagnostic.goto_prev()*
|
• *vim.lsp.diagnostic.goto_prev()*
|
||||||
• *vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
|
• *vim.lsp.diagnostic.redraw()* Use |vim.diagnostic.show()| instead.
|
||||||
• *vim.lsp.diagnostic.reset()*
|
|
||||||
• *vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead.
|
• *vim.lsp.diagnostic.save()* Use |vim.diagnostic.set()| instead.
|
||||||
• *vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead.
|
• *vim.lsp.diagnostic.set_loclist()* Use |vim.diagnostic.setloclist()| instead.
|
||||||
• *vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead.
|
• *vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead.
|
||||||
|
@@ -301,27 +301,6 @@ function M.on_diagnostic(error, result, ctx)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Clear push diagnostics and diagnostic cache.
|
|
||||||
---
|
|
||||||
--- Diagnostic producers should prefer |vim.diagnostic.reset()|. However,
|
|
||||||
--- this method signature is still used internally in some parts of the LSP
|
|
||||||
--- implementation so it's simply marked @private rather than @deprecated.
|
|
||||||
---
|
|
||||||
---@param client_id integer
|
|
||||||
---@param buffer_client_map table<integer, table<integer, table>> map of buffers to active clients
|
|
||||||
---@private
|
|
||||||
function M.reset(client_id, buffer_client_map)
|
|
||||||
buffer_client_map = vim.deepcopy(buffer_client_map)
|
|
||||||
vim.schedule(function()
|
|
||||||
for bufnr, client_ids in pairs(buffer_client_map) do
|
|
||||||
if client_ids[client_id] then
|
|
||||||
local namespace = M.get_namespace(client_id, false)
|
|
||||||
vim.diagnostic.reset(namespace, bufnr)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Get the diagnostics by line
|
--- Get the diagnostics by line
|
||||||
---
|
---
|
||||||
--- Marked private as this is used internally by the LSP subsystem, but
|
--- Marked private as this is used internally by the LSP subsystem, but
|
||||||
|
Reference in New Issue
Block a user