@@ -3,7 +3,9 @@ use helix_dap::Payload;
33use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
44use helix_view::{theme, Editor};
55
6−use crate::{args::Args, compositor::Compositor, config::Config, job::Jobs, ui};
6+use crate::{
7+ args::Args, commands::fetch_stack_trace, compositor::Compositor, config::Config, job::Jobs, ui,
8+};
79
810use log::error;
911use std::{
@@ -273,7 +275,16 @@ impl Application {
273275 all_threads_stopped,
274276 ..
275277 }) => {
276− if let Some(thread_id) = thread_id {
278+ let all_threads_stopped = all_threads_stopped.unwrap_or_default();
279+
280+ if all_threads_stopped {
281+ if let Ok(threads) = debugger.threads().await {
282+ for thread in threads {
283+ fetch_stack_trace(debugger, thread.id).await;
284+ }
285+ select_thread_id(&mut self.editor, thread_id.unwrap_or(0), false).await;
286+ }
287+ } else if let Some(thread_id) = thread_id {
277288 debugger.thread_states.insert(thread_id, reason.clone()); // TODO: dap uses "type" || "reason" here
278289
279290 // whichever thread stops is made "current" (if no previously selected thread).
@@ -292,7 +303,7 @@ impl Application {
292303 if let Some(text) = text {
293304 status.push_str(&format!(" {}", text));
294305 }
295− if all_threads_stopped.unwrap_or_default() {
306+ if all_threads_stopped {
296307 status.push_str(" (all threads stopped)");
297308 }
298309