Skip to content

Commit e56580e

Browse files
committed
feat(provider): add the ability to do custom client name mappings for lsp clients
1 parent d7eacef commit e56580e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lua/astroui/status/provider.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ end
501501
-- @see astroui.status.utils.stylize
502502
function M.lsp_client_names(opts)
503503
opts = extend_tbl({
504+
mappings = {},
504505
integrations = {
505506
null_ls = is_available "none-ls.nvim",
506507
conform = is_available "conform.nvim",
@@ -541,6 +542,9 @@ function M.lsp_client_names(opts)
541542
end
542543
local buf_client_names_set, client_name_lookup = {}, {}
543544
for _, client in ipairs(buf_client_names) do
545+
local mapping = opts.mappings and (opts.mappings[client] or opts.mappings["*"])
546+
if mapping then client = type(mapping) == "string" and mapping or mapping(client) end
547+
if opts.mappings and opts.mappings[client] then client = opts.mappings[client] end
544548
if not client_name_lookup[client] then
545549
client_name_lookup[client] = true
546550
table.insert(buf_client_names_set, client)

0 commit comments

Comments
 (0)