refactor: use vim.deprecate on all deprecated functions

This commit is contained in:
dundargoc
2023-12-25 21:28:28 +01:00
committed by dundargoc
parent 0f22ea400c
commit 5f9d4d8afe
7 changed files with 36 additions and 20 deletions

View File

@@ -1740,7 +1740,7 @@ end
---@private
---@deprecated
function lsp.get_active_clients(filter)
-- TODO: add vim.deprecate call after 0.10 is out for removal in 0.12
vim.deprecate('vim.lsp.get_active_clients()', 'vim.lsp.get_clients()', '0.12')
return lsp.get_clients(filter)
end
@@ -2051,6 +2051,7 @@ end
---@return table result is table of (client_id, client) pairs
---@deprecated Use |vim.lsp.get_clients()| instead.
function lsp.buf_get_clients(bufnr)
vim.deprecate('vim.lsp.buf_get_clients()', 'vim.lsp.get_clients()', '0.12')
local result = {} --- @type table<integer,lsp.Client>
for _, client in ipairs(lsp.get_clients({ bufnr = resolve_bufnr(bufnr) })) do
result[client.id] = client
@@ -2101,6 +2102,11 @@ end
--- buffer number as arguments.
---@deprecated use lsp.get_clients({ bufnr = bufnr }) with regular loop
function lsp.for_each_buffer_client(bufnr, fn)
vim.deprecate(
'vim.lsp.for_each_buffer_client()',
'lsp.get_clients({ bufnr = bufnr }) with regular loop',
'0.12'
)
return for_each_buffer_client(bufnr, fn)
end