add function to add LSP client names (#30)

This commit is contained in:
Jan Steinke
2022-01-22 23:13:57 +01:00
committed by GitHub
parent a30068885d
commit 8feac6c677

View File

@@ -26,7 +26,21 @@ local function get_warning()
return get_diagnostic('W', 'Warning')
end
local function get_lsp_clients()
local clients = vim.lsp.buf_get_clients()
if next(clients) == nil then
return "none"
end
local c = {}
for _, client in ipairs(clients) do
table.insert(c, client.name)
end
return table.concat(c, "|")
end
return {
get_error = get_error,
get_warning = get_warning,
get_lsp_clients = get_lsp_clients,
}