@@ -56,32 +56,7 @@ func RenderLSPList(lspClients *csync.Map[string, *lsp.Client], opts RenderOption
59− // Determine icon color and description based on state
59+ icon, description := iconAndDescription(l, t, lspStates)
60− icon := t.ItemOfflineIcon
61− description := l.LSP.Command
64− description = t.S().Subtle.Render("disabled")
65− } else if state, exists := lspStates[l.Name]; exists {
67− case lsp.StateStarting:
68− icon = t.ItemBusyIcon
69− description = t.S().Subtle.Render("starting...")
71− icon = t.ItemOnlineIcon
72− description = l.LSP.Command
74− icon = t.ItemErrorIcon
75− if state.Error != nil {
76− description = t.S().Subtle.Render(fmt.Sprintf("error: %s", state.Error.Error()))
78− description = t.S().Subtle.Render("error")
80− case lsp.StateDisabled:
81− icon = t.ItemOfflineIcon.Foreground(t.FgMuted)
82− description = t.S().Base.Foreground(t.FgMuted).Render("no root markers found")
86 // Calculate diagnostic counts if we have LSP clients
61 // Calculate diagnostic counts if we have LSP clients
87 var extraContent string
62 var extraContent string
@@ -134,6 +109,30 @@ func RenderLSPList(lspClients *csync.Map[string, *lsp.Client], opts RenderOption
134 return lspList
109 return lspList
112+func iconAndDescription(l config.LSP, t *styles.Theme, states map[string]app.LSPClientInfo) (lipgloss.Style, string) {
114+ return t.ItemOfflineIcon.Foreground(t.FgMuted), t.S().Subtle.Render("disabled")
117+ info := states[l.Name]
119+ case lsp.StateStarting:
120+ return t.ItemBusyIcon, t.S().Subtle.Render("starting...")
121+ case lsp.StateReady:
122+ return t.ItemOnlineIcon, ""
123+ case lsp.StateError:
124+ description := t.S().Subtle.Render("error")
125+ if info.Error != nil {
126+ description = t.S().Subtle.Render(fmt.Sprintf("error: %s", info.Error.Error()))
128+ return t.ItemErrorIcon, description
129+ case lsp.StateDisabled:
130+ return t.ItemOfflineIcon.Foreground(t.FgMuted), t.S().Subtle.Render("inactive")
132+ return t.ItemOfflineIcon, ""
137// RenderLSPBlock renders a complete LSP block with optional truncation indicator.
136// RenderLSPBlock renders a complete LSP block with optional truncation indicator.
138func RenderLSPBlock(lspClients *csync.Map[string, *lsp.Client], opts RenderOptions, showTruncationIndicator bool) string {
137func RenderLSPBlock(lspClients *csync.Map[string, *lsp.Client], opts RenderOptions, showTruncationIndicator bool) string {
139 t := styles.CurrentTheme()
138 t := styles.CurrentTheme()