diff options
Diffstat (limited to 'helix-term/src/application.rs')
-rw-r--r-- | helix-term/src/application.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index 011dafee..dad6df2b 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -1,4 +1,5 @@ use helix_core::syntax; +use helix_dap::Payload; use helix_lsp::{lsp, util::lsp_pos_to_pos, LspProgressMap}; use helix_view::{theme, Editor}; @@ -184,6 +185,29 @@ impl Application { last_render = Instant::now(); } } + Some(payload) = self.editor.debugger_events.next() => { + let mut debugger = self.editor.debugger.as_mut().unwrap(); + match payload { + Payload::Event(ev) => { + match &ev.event[..] { + "stopped" => { + let main = debugger + .threads() + .await + .ok() + .and_then(|threads| threads.get(0).cloned()); + if let Some(main) = main { + let (bt, _) = debugger.stack_trace(main.id).await.unwrap(); + debugger.stack_pointer = bt.get(0).cloned(); + } + } + _ => {} + } + }, + Payload::Response(_) => unreachable!(), + Payload::Request(_) => todo!(), + } + } Some(callback) = self.jobs.futures.next() => { self.jobs.handle_callback(&mut self.editor, &mut self.compositor, callback); self.render(); |