aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-04-05 17:17:35 -0700
committerGitHub <noreply@github.com>2025-04-05 17:17:35 -0700
commit96cfcfde42ebfbd5e1d40da305d2ba460a852b27 (patch)
treeea81642f49cf99b5b19a5fd09c521e9a069a90ca /lua/lspconfig/util.lua
parentdocs: cleanup #3696 (diff)
downloadnvim-lspconfig-96cfcfde42ebfbd5e1d40da305d2ba460a852b27.tar
nvim-lspconfig-96cfcfde42ebfbd5e1d40da305d2ba460a852b27.tar.gz
nvim-lspconfig-96cfcfde42ebfbd5e1d40da305d2ba460a852b27.tar.bz2
nvim-lspconfig-96cfcfde42ebfbd5e1d40da305d2ba460a852b27.tar.lz
nvim-lspconfig-96cfcfde42ebfbd5e1d40da305d2ba460a852b27.tar.xz
nvim-lspconfig-96cfcfde42ebfbd5e1d40da305d2ba460a852b27.tar.zst
nvim-lspconfig-96cfcfde42ebfbd5e1d40da305d2ba460a852b27.zip
refactor: deprecate get_active_client_by_name #3697
Diffstat (limited to 'lua/lspconfig/util.lua')
-rw-r--r--lua/lspconfig/util.lua17
1 files changed, 8 insertions, 9 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index 0935ec40..6b00eb59 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -147,15 +147,9 @@ function M.get_config_by_ft(filetype)
return matching_configs
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(vim.lsp.get_clients { bufnr = bufnr }) do
- if client.name == servername then
- return client
- end
- end
-end
-
+--- Note: In Nvim 0.11+ this currently has no public interface, the healthcheck uses the private
+--- `vim.lsp._enabled_configs`:
+--- https://github.com/neovim/neovim/blob/28e819018520a2300eaeeec6794ffcd614b25dd2/runtime/lua/vim/lsp/health.lua#L186
function M.get_managed_clients()
local configs = require 'lspconfig.configs'
local clients = {}
@@ -369,4 +363,9 @@ function M.add_hook_after(func, new_fn)
end
end
+--- @deprecated Will be removed. Do not use.
+function M.get_active_client_by_name(bufnr, servername)
+ return vim.lsp.get_clients({ bufnr = bufnr, name = servername })[1]
+end
+
return M