fix(statusline): fix lsp active clients
This commit is contained in:
parent
ff3a7a5de4
commit
7fc6a26751
1 changed files with 6 additions and 2 deletions
|
@ -39,9 +39,13 @@ end
|
|||
function M.get_active_lsp_client_names()
|
||||
local active_clients = vim.lsp.get_active_clients()
|
||||
local client_names = {}
|
||||
for i, client in pairs(active_clients) do
|
||||
for i, client in pairs(active_clients or {}) do
|
||||
local buf = vim.api.nvim_get_current_buf()
|
||||
-- only return attached buffers
|
||||
if vim.lsp.buf_is_attached(buf, client.id) then
|
||||
table.insert(client_names, i, client.name)
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(client_names)
|
||||
return client_names
|
||||
|
|
Loading…
Add table
Reference in a new issue