From 7c7cca1b8677bd6e945d56c1465e309d06d03e5e Mon Sep 17 00:00:00 2001 From: RmStorm Date: Fri, 13 Jun 2025 11:32:03 +0200 Subject: [PATCH 1/2] feat: Make the diagnostic picker display the resposible LSP Signed-off-by: RmStorm --- helix-term/src/commands/lsp.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 9c55c830c..55c751fc0 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -252,6 +252,9 @@ fn diag_picker( .into() }, ), + ui::PickerColumn::new("source", |item: &PickerDiagnostic, _| { + item.diag.source.clone().unwrap_or("".to_string()).into() + }), ui::PickerColumn::new("code", |item: &PickerDiagnostic, _| { match item.diag.code.as_ref() { Some(NumberOrString::Number(n)) => n.to_string().into(), From 2e1db95445554201e7eafdb807f0425954e43ec9 Mon Sep 17 00:00:00 2001 From: RmStorm Date: Fri, 13 Jun 2025 19:48:45 +0200 Subject: [PATCH 2/2] Incorporate feedback from @the-mikedavis --- helix-term/src/commands/lsp.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 55c751fc0..0fc9f29bd 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -253,7 +253,7 @@ fn diag_picker( }, ), ui::PickerColumn::new("source", |item: &PickerDiagnostic, _| { - item.diag.source.clone().unwrap_or("".to_string()).into() + item.diag.source.as_deref().unwrap_or("").into() }), ui::PickerColumn::new("code", |item: &PickerDiagnostic, _| { match item.diag.code.as_ref() { @@ -266,12 +266,12 @@ fn diag_picker( item.diag.message.as_str().into() }), ]; - let mut primary_column = 2; // message + let mut primary_column = 3; // message if format == DiagnosticsFormat::ShowSourcePath { columns.insert( // between message code and message - 2, + 3, ui::PickerColumn::new("path", |item: &PickerDiagnostic, _| { if let Some(path) = item.location.uri.as_path() { path::get_truncated_path(path)