aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands/dap.rs
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-09-04 07:14:04 +0000
committerDmitry Sharshakov2021-09-04 07:14:04 +0000
commit9a1916ebfd9d90d3a75207334caf0fe85f305441 (patch)
tree920927e5cb43a4c9674c2f2a548660d69a5353fc /helix-term/src/commands/dap.rs
parent00cccdc62aac16c3b7cbf42b7b2dd8dfebb45563 (diff)
show thread states in thread picker
Diffstat (limited to 'helix-term/src/commands/dap.rs')
-rw-r--r--helix-term/src/commands/dap.rs12
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))