@@ -2,6 +2,7 @@ use helix_core::syntax;
22use helix_dap::Payload;
33use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
44use helix_view::{theme, Editor};
5+use serde_json::from_value;
56
67use crate::{args::Args, compositor::Compositor, config::Config, job::Jobs, ui};
78
@@ -200,6 +201,29 @@ impl Application {
200201 let (bt, _) = debugger.stack_trace(main.id).await.unwrap();
201202 debugger.stack_pointer = bt.get(0).cloned();
202203 }
204+
205+ let body: helix_dap::events::Stopped = from_value(ev.body.expect("`stopped` event must have a body")).unwrap();
206+ let scope = match body.thread_id {
207+ Some(id) => format!("Thread {}", id),
208+ None => "Target".to_owned(),
209+ };
210+
211+ let mut status = format!("{} stopped because of {}", scope, body.reason);
212+ if let Some(desc) = body.description {
213+ status.push_str(&format!(" {}", desc));
214+ }
215+ if let Some(text) = body.text {
216+ status.push_str(&format!(" {}", text));
217+ }
218+ if body.all_threads_stopped == Some(true) {
219+ status.push_str(" (all threads stopped)");
220+ }
221+
222+ self.editor.set_status(status);
223+ self.render();
224+ }
225+ "initialized" => {
226+ self.editor.set_status("Debugged application started".to_owned());
203227 self.render();
204228 }
205229 _ => {}