Something went wrong. Try again.
Neovim Statusline
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132local M = {}
local excluded_names = {}
---Replace the set of exact LSP client names excluded from rendering.---@param names table<string, boolean>function M.set_excluded_names(names) excluded_names = namesend
---Render the names of LSP clients attached to a buffer.---@param buffer integer---@return string? componentfunction M.render(buffer) local names = {}
for _, client in ipairs(vim.lsp.get_clients({ bufnr = buffer })) do if not excluded_names[client.name] then names[#names + 1] = client.name end end
if #names == 0 then return nil end
local display = table.concat(names, " │ "):gsub("%%", "%%%%") return ("%%#StatusLsp# %s %%*"):format(display)end
return M