mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
refactor: use vim.deprecate on all deprecated functions
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user