From 1491cbc8f3694e52a565d192eaef1a7bf200d33f Mon Sep 17 00:00:00 2001 From: Roald Storm Date: Tue, 17 Jun 2025 16:17:46 +0200 Subject: [PATCH] Add diagnostic source to diagnostic pickers (#13758) --- helix-term/src/commands/lsp.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 801e2a9b9..a6d4b424d 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.as_deref().unwrap_or("").into() + }), ui::PickerColumn::new("code", |item: &PickerDiagnostic, _| { match item.diag.code.as_ref() { Some(NumberOrString::Number(n)) => n.to_string().into(), @@ -263,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)