on master help sign in
Workaround for debugging Go tests
2c3e2b9Dmitry Sharshakov
helix-term/src/application.rs+8−5
@@ -273,11 +273,14 @@ impl Application {
273 ..
273 ..
274 }) => {
274 }) => {
275 debugger.is_running = false;
275 debugger.is_running = false;
276− let main = debugger
276+ let main = debugger.threads().await.ok().and_then(|threads| {
277− .threads()
277+ // Workaround for debugging Go tests. Main thread has * in beginning of its name
278− .await
278+ let mut main = threads.iter().find(|t| t.name.starts_with('*')).cloned();
279− .ok()
279+ if main.is_none() {
280− .and_then(|threads| threads.get(0).cloned());
280+ main = threads.get(0).cloned();
281+ }
282+ main
283+ });
281
284
282 if let Some(main) = main {
285 if let Some(main) = main {
283 let (bt, _) = debugger.stack_trace(main.id).await.unwrap();
286 let (bt, _) = debugger.stack_trace(main.id).await.unwrap();