From 514318dbcae86487260f18ecd4c403d8c5f4d44a Mon Sep 17 00:00:00 2001 From: James Trew <66286082+jamestrew@users.noreply.github.com> Date: Mon, 2 Feb 2026 05:15:30 -0500 Subject: [PATCH] fix(ui): show auto-discovered LSPs (#2077) The fix changes iteration from configs-only to all cached states, displaying both configured and auto-discovered LSPs. --- internal/ui/model/lsp.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/ui/model/lsp.go b/internal/ui/model/lsp.go index de33142d51c720265ad84d317b83f5a997f69fac..c46beb10083b420ec1353c8a2536d45093a899b4 100644 --- a/internal/ui/model/lsp.go +++ b/internal/ui/model/lsp.go @@ -2,6 +2,8 @@ package model import ( "fmt" + "maps" + "slices" "strings" "charm.land/lipgloss/v2" @@ -21,16 +23,14 @@ type LSPInfo struct { // lspInfo renders the LSP status section showing active LSP clients and their // diagnostic counts. func (m *UI) lspInfo(width, maxItems int, isSection bool) string { - var lsps []LSPInfo t := m.com.Styles - lspConfigs := m.com.Config().LSP.Sorted() - for _, cfg := range lspConfigs { - state, ok := m.lspStates[cfg.Name] - if !ok { - continue - } + states := slices.SortedFunc(maps.Values(m.lspStates), func(a, b app.LSPClientInfo) int { + return strings.Compare(a.Name, b.Name) + }) + var lsps []LSPInfo + for _, state := range states { client, ok := m.com.App.LSPClients.Get(state.Name) if !ok { continue