From 9a1916ebfd9d90d3a75207334caf0fe85f305441 Mon Sep 17 00:00:00 2001 From: Dmitry Sharshakov Date: Sat, 4 Sep 2021 10:14:04 +0300 Subject: show thread states in thread picker --- helix-term/src/commands/dap.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'helix-term/src/commands') diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs index bb92b3ac..6da6cc81 100644 --- a/helix-term/src/commands/dap.rs +++ b/helix-term/src/commands/dap.rs @@ -102,10 +102,20 @@ fn thread_picker(cx: &mut Context, callback_fn: impl Fn(&mut Editor, &dap::Threa return; } + let thread_states = debugger.thread_states.clone(); let picker = Picker::new( true, threads, - |thread| thread.name.clone().into(), // TODO: include thread_states in the label + move |thread| { + format!( + "{} ({})", + thread.name, + thread_states + .get(&thread.id) + .unwrap_or(&"unknown".to_owned()) + ) + .into() + }, move |editor, thread, _action| callback_fn(editor, thread), ); cx.push_layer(Box::new(picker)) -- cgit v1.2.3-70-g09d2