local M = {} local excluded_names = {} ---Replace the set of exact LSP client names excluded from rendering. ---@param names table function M.set_excluded_names(names) excluded_names = names end ---Render the names of LSP clients attached to a buffer. ---@param buffer integer ---@return string? component function 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