on master help sign in
Add command to run debug target
commite2c74d26e060521b48fb597d5b758d328ad4cfd6 authorDmitry Sharshakov <d3dx12.xx@gmail.com> dateFri 20 Aug 2021, 18:18 (5 years ago) parentc4970c6
2 files changed+12−1
helix-term/src/commands.rs+10 helix-term/src/keymap.rs+2−1
helix-term/src/commands.rs+10
@@ -304,6 +304,7 @@ impl Command {
304304 select_textobject_inner, "Select inside object",
305305 dap_toggle_breakpoint, "Toggle breakpoint",
306306 dap_launch, "Launch debugger",
307+ dap_run, "Begin program execution",
307308 suspend, "Suspend"
308309 );
309310}
@@ -4326,3 +4327,12 @@ fn dap_launch(cx: &mut Context) {
43264327 let _ = block_on(request).unwrap();
43274328 }
43284329}
4330+
4331+fn dap_run(cx: &mut Context) {
4332+ use helix_lsp::block_on;
4333+
4334+ if let Some(debugger) = &mut cx.editor.debugger {
4335+ let request = debugger.configuration_done();
4336+ let _ = block_on(request).unwrap();
4337+ }
4338+}
helix-term/src/keymap.rs+2−1
@@ -486,8 +486,9 @@ impl Default for Keymaps {
486486 "a" => code_action,
487487 "'" => last_picker,
488488 "d" => { "Debug"
489+ "s" => dap_launch,
489490 "b" => dap_toggle_breakpoint,
490− "r" => dap_launch,
491+ "r" => dap_run,
491492 },
492493 "w" => { "Window"
493494 "C-w" | "w" => rotate_view,