Add command to run debug target

This commit is contained in:
Dmitry Sharshakov 2021-08-20 18:18:35 +03:00
parent c4970c617e
commit e2c74d26e0
No known key found for this signature in database
GPG key ID: 471FD32E15FD8473
2 changed files with 12 additions and 1 deletions

View file

@ -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();
}
}

View file

@ -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,