on master help sign in
show thread states in thread picker
9a1916eDmitry Sharshakov
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
102 return;
102 return;
103 }
103 }
104
104
105+ let thread_states = debugger.thread_states.clone();
105 let picker = Picker::new(
106 let picker = Picker::new(
106 true,
107 true,
107 threads,
108 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+ },
109 move |editor, thread, _action| callback_fn(editor, thread),
119 move |editor, thread, _action| callback_fn(editor, thread),
110 );
120 );
111 cx.push_layer(Box::new(picker))
121 cx.push_layer(Box::new(picker))