refactor(lsp): remove usage of deprecated function

This commit is contained in:
Gregory Anders 2021-12-05 19:27:09 -07:00
parent 24f9463dd0
commit bb31d3f21a
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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