diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2021-12-07 10:25:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-07 10:25:21 -0700 |
commit | a2db756206512eca4990abad8d9dad890ade5c0c (patch) | |
tree | 21dcb3fa6eccf3390fc6e0897e8d9bfa5c23ea20 | |
parent | f99f3d90523c2dfd5cdbf45bc1d626b5cd64e9c0 (diff) | |
download | rneovim-a2db756206512eca4990abad8d9dad890ade5c0c.tar.gz rneovim-a2db756206512eca4990abad8d9dad890ade5c0c.tar.bz2 rneovim-a2db756206512eca4990abad8d9dad890ade5c0c.zip |
refactor(lsp): remove usage of deprecated function (#16539)
-rw-r--r-- | runtime/lua/vim/lsp.lua | 3 | ||||
-rw-r--r-- | runtime/lua/vim/lsp/diagnostic.lua | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua index dbbfd7d1d8..95bc4635b0 100644 --- a/runtime/lua/vim/lsp.lua +++ b/runtime/lua/vim/lsp.lua @@ -489,7 +489,8 @@ local function text_document_did_open_handler(bufnr, client) -- Protect against a race where the buffer disappears -- between `did_open_handler` and the scheduled function firing. if vim.api.nvim_buf_is_valid(bufnr) then - vim.lsp.diagnostic.redraw(bufnr, client.id) + local namespace = vim.lsp.diagnostic.get_namespace(client.id) + vim.diagnostic.show(namespace, bufnr) end end) end diff --git a/runtime/lua/vim/lsp/diagnostic.lua b/runtime/lua/vim/lsp/diagnostic.lua index 075da41b23..7c807d9b6f 100644 --- a/runtime/lua/vim/lsp/diagnostic.lua +++ b/runtime/lua/vim/lsp/diagnostic.lua @@ -565,7 +565,7 @@ end --- Redraw diagnostics for the given buffer and client --- ----@deprecated Prefer |vim.diagnostic.redraw()| +---@deprecated Prefer |vim.diagnostic.show()| --- --- This calls the "textDocument/publishDiagnostics" handler manually using --- the cached diagnostics already received from the server. This can be useful |