aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-04-05 16:29:56 -0700
committerGitHub <noreply@github.com>2025-04-05 16:29:56 -0700
commit3dbc4a61e58f632b05c04087c5e788480e5ef81b (patch)
tree9eb85a1493eb89395e754382642262cb17238352 /lua/lspconfig/util.lua
parentrefactor: deprecate util functions #3691 (diff)
downloadnvim-lspconfig-3dbc4a61e58f632b05c04087c5e788480e5ef81b.tar
nvim-lspconfig-3dbc4a61e58f632b05c04087c5e788480e5ef81b.tar.gz
nvim-lspconfig-3dbc4a61e58f632b05c04087c5e788480e5ef81b.tar.bz2
nvim-lspconfig-3dbc4a61e58f632b05c04087c5e788480e5ef81b.tar.lz
nvim-lspconfig-3dbc4a61e58f632b05c04087c5e788480e5ef81b.tar.xz
nvim-lspconfig-3dbc4a61e58f632b05c04087c5e788480e5ef81b.tar.zst
nvim-lspconfig-3dbc4a61e58f632b05c04087c5e788480e5ef81b.zip
refactor: deprecate util.get_lsp_clients #3694
Diffstat (limited to 'lua/lspconfig/util.lua')
-rw-r--r--lua/lspconfig/util.lua17
1 files changed, 10 insertions, 7 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index 1e6b64a7..0e4ab120 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -173,7 +173,7 @@ end
function M.get_active_client_by_name(bufnr, servername)
--TODO(glepnir): remove this for loop when we want only support 0.10+
- for _, client in pairs(M.get_lsp_clients { bufnr = bufnr }) do
+ for _, client in pairs(vim.lsp.get_clients { bufnr = bufnr }) do
if client.name == servername then
return client
end
@@ -264,12 +264,9 @@ function M.tbl_flatten(t)
return nvim_eleven and vim.iter(t):flatten(math.huge):totable() or vim.tbl_flatten(t)
end
-function M.get_lsp_clients(filter)
- --- @diagnostic disable-next-line:deprecated
- return nvim_eleven and lsp.get_clients(filter) or lsp.get_active_clients(filter)
-end
-
+---
--- Deprecated functions
+---
--- @deprecated use `vim.fn.isdirectory(path) == 1` instead
--- @param filename string
@@ -332,7 +329,7 @@ end
--- @deprecated Will be removed. Do not use.
function M.get_active_clients_list_by_ft(filetype)
- local clients = M.get_lsp_clients()
+ local clients = vim.lsp.get_clients()
local clients_list = {}
for _, client in pairs(clients) do
--- @diagnostic disable-next-line:undefined-field
@@ -364,4 +361,10 @@ function M.get_other_matching_providers(filetype)
return other_matching_configs
end
+--- @deprecated Use vim.lsp.get_clients instead.
+function M.get_lsp_clients(filter)
+ --- @diagnostic disable-next-line:deprecated
+ return nvim_eleven and lsp.get_clients(filter) or lsp.get_active_clients(filter)
+end
+
return M