aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-09-06 05:47:54 +0000
committerDmitry Sharshakov2021-09-06 05:47:54 +0000
commit507a1f8dd6a7f88b979a09532a14a10eda72867b (patch)
treebcdcf598102c9f67ee7418756260355269b8f549 /helix-term/src/commands
parentc9cd06e90400969285eb8ecbb4cfb7abeeef59ca (diff)
Get breakpoint reports from debugger
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/dap.rs22
1 files changed, 18 insertions, 4 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index 61b1f438..3fb990c2 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -336,10 +336,24 @@ pub fn dap_toggle_breakpoint(cx: &mut Context) {
None => return,
};
let request = debugger.set_breakpoints(path, breakpoints);
- if let Err(e) = block_on(request) {
- cx.editor
- .set_error(format!("Failed to set breakpoints: {:?}", e));
- }
+ match block_on(request) {
+ Ok(Some(breakpoints)) => {
+ let old_breakpoints = debugger.breakpoints.clone();
+ debugger.breakpoints = breakpoints.clone();
+ for bp in breakpoints {
+ if !old_breakpoints.iter().any(|b| b.message == bp.message) {
+ if let Some(msg) = &bp.message {
+ cx.editor.set_status(format!("Breakpoint set: {}", msg));
+ break;
+ }
+ }
+ }
+ }
+ Err(e) => cx
+ .editor
+ .set_error(format!("Failed to set breakpoints: {:?}", e)),
+ _ => {}
+ };
}
pub fn dap_continue(cx: &mut Context) {