From f002e6f855752dfa7fc197edbfaa84213771e675 Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Thu, 22 Jan 2026 12:11:16 +0100 Subject: [PATCH] fix: lsp sort --- internal/ui/model/lsp.go | 9 ++++++++- internal/ui/model/ui.go | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/internal/ui/model/lsp.go b/internal/ui/model/lsp.go index 61e9f75d478ef51daee465ca7eeca109acd6c64b..de33142d51c720265ad84d317b83f5a997f69fac 100644 --- a/internal/ui/model/lsp.go +++ b/internal/ui/model/lsp.go @@ -23,8 +23,14 @@ type LSPInfo struct { 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 + } - for _, state := range m.lspStates { client, ok := m.com.App.LSPClients.Get(state.Name) if !ok { continue @@ -39,6 +45,7 @@ func (m *UI) lspInfo(width, maxItems int, isSection bool) string { lsps = append(lsps, LSPInfo{LSPClientInfo: state, Diagnostics: lspErrs}) } + title := t.Subtle.Render("LSPs") if isSection { title = common.Section(t, title, width) diff --git a/internal/ui/model/ui.go b/internal/ui/model/ui.go index 0290ab3d44734b1eacc8ab31b244866086ae1f85..01165860f85d85bc9d26a0554c4861e4063b8cb7 100644 --- a/internal/ui/model/ui.go +++ b/internal/ui/model/ui.go @@ -265,6 +265,8 @@ func New(com *common.Common) *UI { completions: comp, attachments: attachments, todoSpinner: todoSpinner, + lspStates: make(map[string]app.LSPClientInfo), + mcpStates: make(map[string]mcp.ClientInfo), } status := NewStatus(com, ui)