Skip to content

Fix lsp_status shows duplicated lsp #1417

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lua/lualine/components/lsp_status.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ end

function M:update_status()
local result = {}
local processed = {}

-- Backwards-compatible function to get the active LSP clients.
---@diagnostic disable-next-line: deprecated
Expand All @@ -77,8 +78,9 @@ function M:update_status()
-- Backwards-compatible function to check if a list contains a value.
local list_contains = vim.list_contains or vim.tbl_contains
-- Append the status to the LSP only if it supports progress reporting and is not ignored.
if not list_contains(self.options.ignore_lsp, client.name) then
if not processed[client.name] and not list_contains(self.options.ignore_lsp, client.name) then
table.insert(result, client.name .. ((status and status ~= '') and (' ' .. status) or ''))
processed[client.name] = true
end
end
return table.concat(result, self.symbols.separator)
Expand Down