@@ -22,6 +22,7 @@ import (
2222 "github.com/charmbracelet/crush/internal/proto"
2323 "github.com/charmbracelet/crush/internal/pubsub"
2424 "github.com/charmbracelet/crush/internal/session"
25+ "github.com/charmbracelet/x/powernap/pkg/lsp/protocol"
2526)
2627
2728// ClientWorkspace implements the Workspace interface by delegating all
@@ -359,8 +360,27 @@ func (w *ClientWorkspace) LSPGetStates() map[string]LSPClientInfo {
359360 return result
360361}
361362
362−func (w *ClientWorkspace) LSPGetClient(_ string) (*lsp.Client, bool) {
363− return nil, false
363+func (w *ClientWorkspace) LSPGetDiagnosticCounts(name string) lsp.DiagnosticCounts {
364+ diags, err := w.client.GetLSPDiagnostics(context.Background(), w.workspaceID(), name)
365+ if err != nil {
366+ return lsp.DiagnosticCounts{}
367+ }
368+ var counts lsp.DiagnosticCounts
369+ for _, fileDiags := range diags {
370+ for _, d := range fileDiags {
371+ switch d.Severity {
372+ case protocol.SeverityError:
373+ counts.Error++
374+ case protocol.SeverityWarning:
375+ counts.Warning++
376+ case protocol.SeverityInformation:
377+ counts.Information++
378+ case protocol.SeverityHint:
379+ counts.Hint++
380+ }
381+ }
382+ }
383+ return counts
364384}
365385
366386// -- Config (read-only) --