From 03032d1f73d8f1d26e6fd846354646cc68fa27a6 Mon Sep 17 00:00:00 2001 From: Maria Solano Date: Sat, 27 Sep 2025 14:53:00 -0700 Subject: [PATCH] fix(lsp): remove `vim.lsp.diagnostic.reset()` (#35938) --- runtime/doc/deprecated.txt | 1 - runtime/lua/vim/lsp/diagnostic.lua | 21 --------------------- 2 files changed, 22 deletions(-) diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index bdedba83d8..fcfb54ce57 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -255,7 +255,6 @@ For each of the functions below, use the corresponding function in • *vim.lsp.diagnostic.goto_next()* • *vim.lsp.diagnostic.goto_prev()* • *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.set_loclist()* Use |vim.diagnostic.setloclist()| instead. • *vim.lsp.diagnostic.set_qflist()* Use |vim.diagnostic.setqflist()| instead. diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index b8ad3f0f00..285dfed17e 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -301,27 +301,6 @@ function M.on_diagnostic(error, result, ctx) 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> 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 --- --- Marked private as this is used internally by the LSP subsystem, but