@@ -29,19 +29,12 @@ func (m *UI) lspInfo(width, maxItems int, isSection bool) string {
2929 if !ok {
3030 continue
3131 }
32+ counts := client.GetDiagnosticCounts()
3233 lspErrs := map[protocol.DiagnosticSeverity]int{
33− protocol.SeverityError: 0,
34− protocol.SeverityWarning: 0,
35− protocol.SeverityHint: 0,
36− protocol.SeverityInformation: 0,
37− }
38−
39− for _, diagnostics := range client.GetDiagnostics() {
40− for _, diagnostic := range diagnostics {
41− if severity, ok := lspErrs[diagnostic.Severity]; ok {
42− lspErrs[diagnostic.Severity] = severity + 1
43− }
44− }
34+ protocol.SeverityError: counts.Error,
35+ protocol.SeverityWarning: counts.Warning,
36+ protocol.SeverityHint: counts.Hint,
37+ protocol.SeverityInformation: counts.Information,
4538 }
4639
4740 lsps = append(lsps, LSPInfo{LSPClientInfo: state, Diagnostics: lspErrs})