eglot-alternatives无法进行单步调试
(defun eglot-alternatives (alternatives)
(lambda (&optional interactive)
(let* ((listified (cl-loop for a in alternatives
collect (if (listp a) a (list a))))
(err (lambda ()
(error "None of '%s' are valid executables"
(mapconcat #'car listified ", ")))))
(cond (interactive
(let* ((augmented (mapcar (lambda (a)
(let ((found (eglot--executable-find
(car a) t)))
(and found
(cons (car a) (cons found (cdr a))))))
listified))
(available (remove nil augmented)))
(cond ((cdr available)
(cdr (assoc
(completing-read
"[eglot] More than one server executable available: "
(mapcar #'car available)
nil t nil nil (car (car available)))
available #'equal)))
((cdr (car available)))
(t nil))))
(t
(cl-loop for (p . args) in listified
for probe = (eglot--executable-find p t)
when probe return (cons probe args)
finally (funcall err)))))))
fac可以进行单步调试
(defun fac (n)
(if (< 0 n)
(* n (fac (1- n)))
1))