home: vim: lua: move 'list_clients' to lsp'

This commit is contained in:
Bruno BELANYI 2026-01-26 16:53:16 +00:00
parent 7202fa1911
commit 852ded641a
3 changed files with 16 additions and 16 deletions

View file

@ -85,4 +85,18 @@ M.on_attach = function(client, bufnr)
wk.add(keys)
end
--- list all active LSP clients for specific buffer, or all buffers
--- @param bufnr int? buffer number
--- @return table all active LSP client names
M.list_clients = function(bufnr)
local clients = vim.lsp.get_clients({ bufnr = bufnr })
local names = {}
for _, client in ipairs(clients) do
table.insert(names, client.name)
end
return names
end
return M

View file

@ -34,20 +34,6 @@ M.is_ssh = function()
return false
end
--- list all active LSP clients for specific buffer, or all buffers
--- @param bufnr int? buffer number
--- @return table all active LSP client names
M.list_lsp_clients = function(bufnr)
local clients = vim.lsp.get_clients({ bufnr = bufnr })
local names = {}
for _, client in ipairs(clients) do
table.insert(names, client.name)
end
return names
end
--- partially apply a function with given arguments
M.partial = function(f, ...)
local a = { ... }