fix(ui): show auto-discovered LSPs (#2077)

James Trew created

The fix changes iteration from configs-only to all cached states,
displaying both configured and auto-discovered LSPs.

Change summary

internal/ui/model/lsp.go | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

Detailed changes

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