@@ -303,8 +303,7 @@ impl Command {
303303 select_textobject_around, "Select around object",
304304 select_textobject_inner, "Select inside object",
305305 dap_toggle_breakpoint, "Toggle breakpoint",
306− dap_init, "Start debug session",
307− dap_launch, "Launch debugger",
306+ dap_start, "Start debug session",
308307 dap_run, "Begin program execution",
309308 suspend, "Suspend"
310309 );
@@ -4245,9 +4244,11 @@ fn suspend(_cx: &mut Context) {
42454244}
42464245
42474246// DAP
4248−fn dap_init(cx: &mut Context) {
4247+fn dap_start(cx: &mut Context) {
42494248 use helix_dap::Client;
42504249 use helix_lsp::block_on;
4250+ use serde_json::to_value;
4251+
42514252 let (_, _doc) = current!(cx.editor);
42524253
42534254 // look up config for filetype
@@ -4259,6 +4260,13 @@ fn dap_init(cx: &mut Context) {
42594260 let request = debugger.initialize("go".to_owned());
42604261 let _ = block_on(request).unwrap();
42614262
4263+ let mut args = HashMap::new();
4264+ args.insert("mode", "debug");
4265+ args.insert("program", "main.go");
4266+
4267+ let request = debugger.launch(to_value(args).unwrap());
4268+ let _ = block_on(request).unwrap();
4269+
42624270 // TODO: either await "initialized" or buffer commands until event is received
42634271
42644272 cx.editor.debugger = Some(debugger);
@@ -4303,20 +4311,6 @@ fn dap_toggle_breakpoint(cx: &mut Context) {
43034311 }
43044312}
43054313
4306−fn dap_launch(cx: &mut Context) {
4307− use helix_lsp::block_on;
4308− use serde_json::to_value;
4309−
4310− if let Some(debugger) = &mut cx.editor.debugger {
4311− let mut args = HashMap::new();
4312− args.insert("mode", "debug");
4313− args.insert("program", "main.go");
4314−
4315− let request = debugger.launch(to_value(args).unwrap());
4316− let _ = block_on(request).unwrap();
4317− }
4318−}
4319−
43204314fn dap_run(cx: &mut Context) {
43214315 use helix_lsp::block_on;
43224316