Skip to content

Commit d385752

Browse files
committed
dap-python: debug-test-at-point: support debugpy
Fixes #396.
1 parent 28e2bea commit d385752

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

dap-python.el

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,20 @@ overriden in individual `dap-python' launch configurations."
248248
(plist-put conf :program program)
249249
conf))
250250

251+
(defun dap-python--normalize-args (args)
252+
"Convert ARGS to a `list' of arguments.
253+
ARGS may be a string, a vector or a list."
254+
(cl-typecase args
255+
(string (split-string-and-unquote args))
256+
(vector (cl-coerce args 'list))
257+
(t args)))
258+
251259
(defun dap-python--populate-test-at-point (conf)
252260
"Populate CONF with the required arguments."
253261
(if-let ((test (dap-python--test-at-point)))
254-
(plist-put conf :target-module (concat (buffer-file-name) test))
262+
(let ((args (dap-python--normalize-args (plist-get conf :args))))
263+
(cl-remf conf :args)
264+
(plist-put conf :args (cons (concat (buffer-file-name) test) args)))
255265
(user-error "`dap-python': no test at point"))
256266
(plist-put conf :cwd (lsp-workspace-root))
257267

0 commit comments

Comments
 (0)