fix: correct versions in deprecation warnings

The following functions should be removed in 0.12 according to the
deprecation strategy in MAINTAIN.md:

- vim.lsp.util.extract_completion_items()
- vim.lsp.util.parse_snippet()
- vim.lsp.util.text_document_completion_list_to_complete_items()
This commit is contained in:
dundargoc 2023-12-26 15:16:45 +01:00 committed by dundargoc
parent 5f9d4d8afe
commit 5cb906e91c

View File

@ -553,7 +553,7 @@ end
---@return lsp.CompletionItem[] List of completion items
---@see https://microsoft.github.io/language-server-protocol/specification#textDocument_completion
function M.extract_completion_items(result)
vim.deprecate('vim.lsp.util.extract_completion_items()', nil, '0.11')
vim.deprecate('vim.lsp.util.extract_completion_items()', nil, '0.12')
if type(result) == 'table' and result.items then
-- result is a `CompletionList`
return result.items
@ -613,7 +613,7 @@ end
---@param input string unparsed snippet
---@return string parsed snippet
function M.parse_snippet(input)
vim.deprecate('vim.lsp.util.parse_snippet()', nil, '0.11')
vim.deprecate('vim.lsp.util.parse_snippet()', nil, '0.12')
local ok, parsed = pcall(function()
return snippet.parse(input)
end)
@ -635,7 +635,7 @@ end
---@return table[] items
---@see complete-items
function M.text_document_completion_list_to_complete_items(result, prefix)
vim.deprecate('vim.lsp.util.text_document_completion_list_to_complete_items()', nil, '0.11')
vim.deprecate('vim.lsp.util.text_document_completion_list_to_complete_items()', nil, '0.12')
return require('vim.lsp._completion')._lsp_to_complete_items(result, prefix)
end