diff options
author | Dmitry Sharshakov | 2021-09-04 07:14:04 +0000 |
---|---|---|
committer | Dmitry Sharshakov | 2021-09-04 07:14:04 +0000 |
commit | 9a1916ebfd9d90d3a75207334caf0fe85f305441 (patch) | |
tree | 920927e5cb43a4c9674c2f2a548660d69a5353fc /helix-term/src/commands | |
parent | 00cccdc62aac16c3b7cbf42b7b2dd8dfebb45563 (diff) |
show thread states in thread picker
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r-- | helix-term/src/commands/dap.rs | 12 |
1 files changed, 11 insertions, 1 deletions
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)) |