aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src
diff options
context:
space:
mode:
authorDmitry Sharshakov2021-08-20 15:18:35 +0000
committerDmitry Sharshakov2021-08-20 15:18:35 +0000
commite2c74d26e060521b48fb597d5b758d328ad4cfd6 (patch)
tree54ba088a5dbfa993c5e9ebfe75f41193b352be87 /helix-term/src
parentc4970c617ed5f03dadce2a284b66539bf0ce3054 (diff)
Add command to run debug target
Diffstat (limited to 'helix-term/src')
-rw-r--r--helix-term/src/commands.rs10
-rw-r--r--helix-term/src/keymap.rs3
2 files changed, 12 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index 74b272c6..1139a0dc 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -304,6 +304,7 @@ impl Command {
select_textobject_inner, "Select inside object",
dap_toggle_breakpoint, "Toggle breakpoint",
dap_launch, "Launch debugger",
+ dap_run, "Begin program execution",
suspend, "Suspend"
);
}
@@ -4326,3 +4327,12 @@ fn dap_launch(cx: &mut Context) {
let _ = block_on(request).unwrap();
}
}
+
+fn dap_run(cx: &mut Context) {
+ use helix_lsp::block_on;
+
+ if let Some(debugger) = &mut cx.editor.debugger {
+ let request = debugger.configuration_done();
+ let _ = block_on(request).unwrap();
+ }
+}
diff --git a/helix-term/src/keymap.rs b/helix-term/src/keymap.rs
index 840bd7e6..651fbdf2 100644
--- a/helix-term/src/keymap.rs
+++ b/helix-term/src/keymap.rs
@@ -486,8 +486,9 @@ impl Default for Keymaps {
"a" => code_action,
"'" => last_picker,
"d" => { "Debug"
+ "s" => dap_launch,
"b" => dap_toggle_breakpoint,
- "r" => dap_launch,
+ "r" => dap_run,
},
"w" => { "Window"
"C-w" | "w" => rotate_view,