Skip to content

Commit c217371

Browse files
committed
Fix regression in dap-debug
- it could be called non interativelly and it should populate the debug args
1 parent 51cfb1a commit c217371

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

dap-mode.el

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ should be started after the :port argument is taken.
942942
(default-directory (or cwd default-directory)))
943943
(mapc (-lambda ((env . value)) (setenv env value)) environment-variables)
944944

945-
(when program-to-start(compile program-to-start))
945+
(when program-to-start (compile program-to-start))
946946
(when wait-for-port (dap--wait-for-port host port))
947947

948948
(unless skip-debug-session
@@ -1143,8 +1143,16 @@ CONFIGURATION-SETTINGS - plist containing the preset settings for the configurat
11431143
11441144
If DEBUG-ARGS is not specified the configuration is generated
11451145
after selecting configuration template."
1146-
(interactive (list (dap--select-template)))
1147-
(dap-start-debugging debug-args))
1146+
(interactive (list (-> (dap--completing-read "Select configuration template: "
1147+
dap--debug-template-configurations
1148+
'first nil t)
1149+
rest
1150+
copy-tree)))
1151+
(dap-start-debugging (or (-some-> (plist-get debug-args :type)
1152+
(gethash dap--debug-providers)
1153+
(funcall debug-args))
1154+
(error "There is no debug provider for language %s"
1155+
(or (plist-get debug-args :type) "'Not specified'")))))
11481156

11491157
(defun dap-debug-edit-template (debug-args)
11501158
"Edit template DEBUG-ARGS."

0 commit comments

Comments
 (0)