on main help sign in
fix(server): show LSP status in client-server mode
commitf98791e9868dc4d3acdebe331d69e68cf4fdd331 authorChristian Rocha <christian@rocha.is> dateWed 17 Jun 2026, 17:38 (4 months ago) parent46c1799
2 files changed+8−6
internal/ui/model/lsp.go+3−3 internal/ui/model/ui.go+5−3
internal/ui/model/lsp.go+3−3
@@ -7,16 +7,16 @@ import (
77 "strings"
88
99 "charm.land/lipgloss/v2"
10− "github.com/charmbracelet/crush/internal/app"
1110 "github.com/charmbracelet/crush/internal/lsp"
1211 "github.com/charmbracelet/crush/internal/ui/common"
1312 "github.com/charmbracelet/crush/internal/ui/styles"
13+ "github.com/charmbracelet/crush/internal/workspace"
1414 "github.com/charmbracelet/x/powernap/pkg/lsp/protocol"
1515)
1616
1717// LSPInfo wraps LSP client information with diagnostic counts by severity.
1818type LSPInfo struct {
19− app.LSPClientInfo
19+ workspace.LSPClientInfo
2020 Diagnostics map[protocol.DiagnosticSeverity]int
2121}
2222
@@ -25,7 +25,7 @@ type LSPInfo struct {
2525func (m *UI) lspInfo(width, maxItems int, isSection bool) string {
2626 t := m.com.Styles
2727
28− states := slices.SortedFunc(maps.Values(m.lspStates), func(a, b app.LSPClientInfo) int {
28+ states := slices.SortedFunc(maps.Values(m.lspStates), func(a, b workspace.LSPClientInfo) int {
2929 return strings.Compare(a.Name, b.Name)
3030 })
3131
internal/ui/model/ui.go+5−3
@@ -227,7 +227,7 @@ type UI struct {
227227 }
228228
229229 // lsp
230− lspStates map[string]app.LSPClientInfo
230+ lspStates map[string]workspace.LSPClientInfo
231231
232232 // mcp
233233 mcpStates map[string]mcp.ClientInfo
@@ -337,7 +337,7 @@ func New(com *common.Common, initialSessionID string, continueLast bool) *UI {
337337 completions: comp,
338338 attachments: attachments,
339339 todoSpinner: todoSpinner,
340− lspStates: make(map[string]app.LSPClientInfo),
340+ lspStates: make(map[string]workspace.LSPClientInfo),
341341 mcpStates: make(map[string]mcp.ClientInfo),
342342 notifyBackend: notification.NoopBackend{},
343343 notifyWindowFocused: true,
@@ -707,7 +707,9 @@ func (m *UI) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
707707 case pubsub.Event[history.File]:
708708 cmds = append(cmds, m.handleFileEvent(msg.Payload))
709709 case pubsub.Event[app.LSPEvent]:
710− m.lspStates = app.GetLSPStates()
710+ m.lspStates = m.com.Workspace.LSPGetStates()
711+ case pubsub.Event[workspace.LSPEvent]:
712+ m.lspStates = m.com.Workspace.LSPGetStates()
711713 case pubsub.Event[skills.Event]:
712714 m.skillStates = msg.Payload.States
713715 case pubsub.Event[mcp.Event]: