diff options
author | kylo252 <[email protected]> | 2021-12-13 17:58:35 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-12-13 17:58:35 +0100 |
commit | 6cf21e9ddec41addf01744176afb2e138b3e1b3f (patch) | |
tree | 4abf843da0e2ed38689c872694b13d7418536106 /lua/lvim/lsp/utils.lua | |
parent | 3a2d62ed2510ca05eb6ea87240a86df82338f5aa (diff) | |
parent | b09ada89402e668ea1636bdbf671a89330199717 (diff) |
Merge LunarVim/release-candidate
Diffstat (limited to 'lua/lvim/lsp/utils.lua')
-rw-r--r-- | lua/lvim/lsp/utils.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lua/lvim/lsp/utils.lua b/lua/lvim/lsp/utils.lua index 7cc8f54f..df3846ce 100644 --- a/lua/lvim/lsp/utils.lua +++ b/lua/lvim/lsp/utils.lua @@ -22,22 +22,23 @@ 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 + else + client = vim.lsp.get_client_by_id(tonumber(client_id)) end - if not client_id then + if not client then error "Unable to determine 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 |