feat: multiple enhancements to lvim-reload (#2054)

This commit is contained in:
kylo252 2021-12-09 17:08:53 +01:00 committed by GitHub
parent 68cdb62f87
commit 307db8936b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 64 additions and 32 deletions

View file

@ -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