From 307db8936b291b82124f05bdcfeb85be5464f21d Mon Sep 17 00:00:00 2001 From: kylo252 <59826753+kylo252@users.noreply.github.com> Date: Thu, 9 Dec 2021 17:08:53 +0100 Subject: feat: multiple enhancements to lvim-reload (#2054) --- lua/lvim/lsp/utils.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'lua/lvim/lsp/utils.lua') diff --git a/lua/lvim/lsp/utils.lua b/lua/lvim/lsp/utils.lua index 7cc8f54f..7659972e 100644 --- a/lua/lvim/lsp/utils.lua +++ b/lua/lvim/lsp/utils.lua @@ -22,11 +22,12 @@ function M.get_active_clients_by_ft(filetype) end function M.get_client_capabilities(client_id) + local client if not client_id then local buf_clients = vim.lsp.buf_get_clients() - for _, buf_client in ipairs(buf_clients) do + for _, buf_client in pairs(buf_clients) do if buf_client.name ~= "null-ls" then - client_id = buf_client.id + client = buf_client break end end @@ -36,8 +37,6 @@ function M.get_client_capabilities(client_id) return end - local client = vim.lsp.get_client_by_id(tonumber(client_id)) - local enabled_caps = {} for capability, status in pairs(client.resolved_capabilities) do if status == true then -- cgit v1.2.3