on master help sign in
show thread states in thread picker
commit9a1916ebfd9d90d3a75207334caf0fe85f305441 authorDmitry Sharshakov <d3dx12.xx@gmail.com> dateSat 4 Sep 2021, 10:14 (5 years ago) parent00cccdc
1 file changed+11−1
helix-term/src/commands/dap.rs+11−1
helix-term/src/commands/dap.rs+11−1
@@ -102,10 +102,20 @@ fn thread_picker(cx: &mut Context, callback_fn: impl Fn(&mut Editor, &dap::Threa
102102 return;
103103 }
104104
105+ let thread_states = debugger.thread_states.clone();
105106 let picker = Picker::new(
106107 true,
107108 threads,
108− |thread| thread.name.clone().into(), // TODO: include thread_states in the label
109+ move |thread| {
110+ format!(
111+ "{} ({})",
112+ thread.name,
113+ thread_states
114+ .get(&thread.id)
115+ .unwrap_or(&"unknown".to_owned())
116+ )
117+ .into()
118+ },
109119 move |editor, thread, _action| callback_fn(editor, thread),
110120 );
111121 cx.push_layer(Box::new(picker))