From a284b14b3a9c4851f900286cd7eb68e3a8f90b1c Mon Sep 17 00:00:00 2001 From: glepnir Date: Fri, 17 May 2024 17:40:27 +0800 Subject: refactor: move all old get_clients to new compatible (#3159) --- lua/lspconfig/util.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lua/lspconfig/util.lua') 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 -- cgit v1.2.3-70-g09d2