aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands.rs
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-08-24 07:48:47 +0000
committerDmitry Sharshakov2021-08-24 07:48:47 +0000
commitfdad7d67aa158c963a4b5397e9d7de960706cd2a (patch)
tree49a27255ffb5e92301c1744d4270b4f97aa84c12 /helix-term/src/commands.rs
parentc4085b4e8885a32a7b05529fe873d38d185ce886 (diff)
Check capabilities for breakpoint config
Diffstat (limited to 'helix-term/src/commands.rs')
-rw-r--r--helix-term/src/commands.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 42591ac4..74466e7e 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -1949,6 +1949,34 @@ mod cmd {
}
};
if let Some(debugger) = &mut cx.editor.debugger {
+ if breakpoint.condition.is_some()
+ && !debugger
+ .caps
+ .clone()
+ .unwrap()
+ .supports_conditional_breakpoints
+ .unwrap_or_default()
+ {
+ cx.editor.set_error(
+ "Can't edit breakpoint: debugger does not support conditional breakpoints"
+ .to_string(),
+ );
+ return;
+ }
+ if breakpoint.log_message.is_some()
+ && !debugger
+ .caps
+ .clone()
+ .unwrap()
+ .supports_log_points
+ .unwrap_or_default()
+ {
+ cx.editor.set_error(
+ "Can't edit breakpoint: debugger does not support logpoints".to_string(),
+ );
+ return;
+ }
+
let breakpoints = debugger.breakpoints.entry(path.clone()).or_default();
if let Some(pos) = breakpoints.iter().position(|b| b.line == breakpoint.line) {
breakpoints.remove(pos);