on master help sign in
report status when target started or stopped
5a06263Dmitry Sharshakov
helix-term/src/application.rs+24
@@ -2,6 +2,7 @@ use helix_core::syntax;
2use helix_dap::Payload;
2use helix_dap::Payload;
3use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
3use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
4use helix_view::{theme, Editor};
4use helix_view::{theme, Editor};
5+use serde_json::from_value;
5
6
6use crate::{args::Args, compositor::Compositor, config::Config, job::Jobs, ui};
7use crate::{args::Args, compositor::Compositor, config::Config, job::Jobs, ui};
7
8
@@ -200,6 +201,29 @@ impl Application {
200 let (bt, _) = debugger.stack_trace(main.id).await.unwrap();
201 let (bt, _) = debugger.stack_trace(main.id).await.unwrap();
201 debugger.stack_pointer = bt.get(0).cloned();
202 debugger.stack_pointer = bt.get(0).cloned();
202 }
203 }
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());
203 self.render();
227 self.render();
204 }
228 }
205 _ => {}
229 _ => {}