aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-08-21 17:08:37 +0000
committerDmitry Sharshakov2021-08-21 17:08:37 +0000
commit5a06263b787710d15278a3caa9fef0f302442b61 (patch)
tree8c161a372671e2edbd6bf4e5d98338cba9741382 /helix-term/src
parentbcab93c94ed7a62f2775c8c3e38196c08331f19b (diff)
report status when target started or stopped
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/application.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs
index 0e988a1a..2e7d16db 100644
--- a/helix-term/src/application.rs
+++ b/helix-term/src/application.rs
@@ -2,6 +2,7 @@ use helix_core::syntax;
use helix_dap::Payload;
use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap};
use helix_view::{theme, Editor};
+use serde_json::from_value;
use crate::{args::Args, compositor::Compositor, config::Config, job::Jobs, ui};
@@ -200,6 +201,29 @@ impl Application {
let (bt, _) = debugger.stack_trace(main.id).await.unwrap();
debugger.stack_pointer = bt.get(0).cloned();
}
+
+ let body: helix_dap::events::Stopped = from_value(ev.body.expect("`stopped` event must have a body")).unwrap();
+ let scope = match body.thread_id {
+ Some(id) => format!("Thread {}", id),
+ None => "Target".to_owned(),
+ };
+
+ let mut status = format!("{} stopped because of {}", scope, body.reason);
+ if let Some(desc) = body.description {
+ status.push_str(&format!(" {}", desc));
+ }
+ if let Some(text) = body.text {
+ status.push_str(&format!(" {}", text));
+ }
+ if body.all_threads_stopped == Some(true) {
+ status.push_str(" (all threads stopped)");
+ }
+
+ self.editor.set_status(status);
+ self.render();
+ }
+ "initialized" => {
+ self.editor.set_status("Debugged application started".to_owned());
self.render();
}
_ => {}