aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2024-05-17 17:40:27 +0800
committerGitHub <noreply@github.com>2024-05-17 17:40:27 +0800
commita284b14b3a9c4851f900286cd7eb68e3a8f90b1c (patch)
treebd7cbec9ebfcf54f0858bda150b28e1b65ee270b /lua/lspconfig/util.lua
parentfix: use new version as check condition (#3157) (diff)
downloadnvim-lspconfig-a284b14b3a9c4851f900286cd7eb68e3a8f90b1c.tar
nvim-lspconfig-a284b14b3a9c4851f900286cd7eb68e3a8f90b1c.tar.gz
nvim-lspconfig-a284b14b3a9c4851f900286cd7eb68e3a8f90b1c.tar.bz2
nvim-lspconfig-a284b14b3a9c4851f900286cd7eb68e3a8f90b1c.tar.lz
nvim-lspconfig-a284b14b3a9c4851f900286cd7eb68e3a8f90b1c.tar.xz
nvim-lspconfig-a284b14b3a9c4851f900286cd7eb68e3a8f90b1c.tar.zst
nvim-lspconfig-a284b14b3a9c4851f900286cd7eb68e3a8f90b1c.zip
refactor: move all old get_clients to new compatible (#3159)
Diffstat (limited to 'lua/lspconfig/util.lua')
-rw-r--r--lua/lspconfig/util.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index cf83f1a8..a06bfa09 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -266,7 +266,7 @@ function M.tbl_flatten(t)
return nvim_ten and vim.iter(t):flatten(math.huge):totable() or vim.tbl_flatten(t)
end
-local function get_lsp_clients(filter)
+function M.get_lsp_clients(filter)
return nvim_ten and lsp.get_clients(filter) or lsp.get_active_clients(filter)
end
@@ -342,7 +342,7 @@ function M.insert_package_json(config_files, field, fname)
end
function M.get_active_clients_list_by_ft(filetype)
- local clients = get_lsp_clients()
+ local clients = M.get_lsp_clients()
local clients_list = {}
for _, client in pairs(clients) do
local filetypes = client.config.filetypes or {}
@@ -388,7 +388,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(get_lsp_clients { bufnr = bufnr }) do
+ for _, client in pairs(M.get_lsp_clients { bufnr = bufnr }) do
if client.name == servername then
return client
end