Function: dape-select-thread

dape-select-thread is an interactive and natively compiled function defined in dape.el.

Signature

(dape-select-thread CONN THREAD-ID)

Documentation

Select current active thread.

With prefix argument thread is selected by index starting at 1. The thread is identified by THREAD-ID under adapter CONN.

Key Bindings

ctl-x-map C-a t dape-global-map t global-map C-x C-a t help-quick-use-map C-x C-a t

Source Code

;; Defined in /nix/store/1fiaif8pifqj2jh65rbg3fkhg3i56q42-emacs-packages-deps/share/emacs/site-lisp/elpa/dape-0.27.1/dape.el
(defun dape-select-thread (conn thread-id)
  "Select current active thread.
With prefix argument thread is selected by index starting at 1.
The thread is identified by THREAD-ID under adapter CONN."
  (interactive
   (let* ((conn (dape--live-connection 'last))
          (collection
           (cl-loop with index = 0
                    for conn in (dape--session-connections conn) append
                    (cl-loop for thread in (dape--threads conn) collect
                             (list (format "%s %s" (cl-incf index)
                                           (plist-get thread :name))
                                   conn
                                   (plist-get thread :id)))))
          (thread-name
           (if (numberp current-prefix-arg)
               (car (nth (1- current-prefix-arg) collection))
             (completing-read
              (format "Select thread (current %s): "
                      (thread-first conn (dape--current-thread)
                                    (plist-get :name)))
              collection nil t))))
     (alist-get thread-name collection nil nil #'equal)))
  (setf (dape--thread-id conn) thread-id)
  (setq dape--connection-selected conn)
  (dape--update conn nil t)
  (dape--mode-line-format))