aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/ui/statusline.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2023-05-19 00:39:35 +0000
committerGitHub2023-05-19 00:39:35 +0000
commit53f47bc47771c94dab51626ca025be28e62eba0c (patch)
treec8f5c59d40d1ecde227c209f898cc7afd6da5477 /helix-term/src/ui/statusline.rs
parent7f5940be80eaa3aec7903903072b7108f41dd97b (diff)
parent2a512f7c487f0a707a7eb158e24bd478433bcd91 (diff)
Merge pull request #2507 from Philipp-M/multiple-language-servers
Add support for multiple language servers per language
Diffstat (limited to 'helix-term/src/ui/statusline.rs')
-rw-r--r--helix-term/src/ui/statusline.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs
index 88786351..4aa64634 100644
--- a/helix-term/src/ui/statusline.rs
+++ b/helix-term/src/ui/statusline.rs
@@ -197,15 +197,15 @@ where
);
}
+// TODO think about handling multiple language servers
fn render_lsp_spinner<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
{
+ let language_server = context.doc.language_servers().next();
write(
context,
- context
- .doc
- .language_server()
+ language_server
.and_then(|srv| {
context
.spinners
@@ -225,8 +225,7 @@ where
{
let (warnings, errors) = context
.doc
- .diagnostics()
- .iter()
+ .shown_diagnostics()
.fold((0, 0), |mut counts, diag| {
use helix_core::diagnostic::Severity;
match diag.severity {
@@ -266,7 +265,7 @@ where
.diagnostics
.values()
.flatten()
- .fold((0, 0), |mut counts, diag| {
+ .fold((0, 0), |mut counts, (diag, _)| {
match diag.severity {
Some(DiagnosticSeverity::WARNING) => counts.0 += 1,
Some(DiagnosticSeverity::ERROR) | None => counts.1 += 1,