Remove dash dependency
This commit is contained in:
parent
462efded5f
commit
44803038b2
1 changed files with 19 additions and 18 deletions
|
@ -28,16 +28,16 @@ the debugging configuration of the current buffer."
|
||||||
(bound-and-true-p lsp--buffer-deferred)
|
(bound-and-true-p lsp--buffer-deferred)
|
||||||
(require 'dap-mode nil t)
|
(require 'dap-mode nil t)
|
||||||
dap-mode)
|
dap-mode)
|
||||||
(--map (cons 'dap it)
|
(mapcar (lambda (c) (cons 'dap c))
|
||||||
(-mapcat #'funcall dap-launch-configuration-providers))))
|
(apply 'append (mapcar #'funcall dap-launch-configuration-providers)))))
|
||||||
|
|
||||||
(defun +debugger-list-for-realgud ()
|
(defun +debugger-list-for-realgud ()
|
||||||
(--map (cons 'realgud (list (symbol-name it)))
|
(mapcar (lambda (c) (cons 'realgud (list (symbol-name c))))
|
||||||
(cl-loop for (sym . plist) in +debugger--realgud-alist
|
(cl-loop for (sym . plist) in +debugger--realgud-alist
|
||||||
for sym-name = (symbol-name sym)
|
for sym-name = (symbol-name sym)
|
||||||
for modes = (plist-get plist :modes)
|
for modes = (plist-get plist :modes)
|
||||||
if (or (null modes) (apply #'derived-mode-p modes))
|
if (or (null modes) (apply #'derived-mode-p modes))
|
||||||
collect sym)))
|
collect sym)))
|
||||||
|
|
||||||
;; Based on dap--completing-read and dap-debug
|
;; Based on dap--completing-read and dap-debug
|
||||||
(defun +debugger-completing-read ()
|
(defun +debugger-completing-read ()
|
||||||
|
@ -49,20 +49,21 @@ infromation."
|
||||||
(let* ((configurations (append
|
(let* ((configurations (append
|
||||||
(+debugger-list-for-dap)
|
(+debugger-list-for-dap)
|
||||||
(+debugger-list-for-realgud)))
|
(+debugger-list-for-realgud)))
|
||||||
(result (--map (cons (cadr it) it) configurations))
|
(result (mapcar (lambda (c) (cons (cadr c) c)) configurations))
|
||||||
(completion (completing-read "Start debugger: " (-map 'car result) nil t)))
|
(completion (completing-read "Start debugger: " (mapcar 'car result) nil t)))
|
||||||
(if (eq completion "")
|
(if (or (null completion) (eq completion ""))
|
||||||
(user-error "No debugging configuration specified.")
|
(user-error "No debugging configuration specified.")
|
||||||
(let ((configuration (cdr (assoc completion result))))
|
(let ((configuration (cdr (assoc completion result))))
|
||||||
(if (eq (car configuration) 'dap)
|
(if (eq (car configuration) 'dap)
|
||||||
;; get dap debugging arguments
|
;; get dap debugging arguments
|
||||||
(let* ((debug-args (-> (cdr configuration)
|
(let* ((debug-args (dap-variables-expand-in-launch-configuration (copy-tree
|
||||||
cl-rest
|
(cl-rest
|
||||||
copy-tree
|
(cdr configuration)))))
|
||||||
dap-variables-expand-in-launch-configuration))
|
(launch-args (or (catch 'is-nil
|
||||||
(launch-args (or (-some-> (plist-get debug-args :type)
|
(funcall (or (gethash
|
||||||
(gethash dap--debug-providers)
|
(or (plist-get debug-args :type)
|
||||||
(funcall debug-args))
|
(throw 'is-nil nil)) dap--debug-providers)
|
||||||
|
(throw 'is-nil nil)) debug-args))
|
||||||
(user-error "Have you loaded the `%s' specific dap package?"
|
(user-error "Have you loaded the `%s' specific dap package?"
|
||||||
(or (plist-get debug-args :type)
|
(or (plist-get debug-args :type)
|
||||||
(user-error "%s does not specify :type" debug-args))))))
|
(user-error "%s does not specify :type" debug-args))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue