Skip to content

Commit

Permalink
Improve current connection guesses
Browse files Browse the repository at this point in the history
Trying hard to avoid a new buffer with connection selection.  Maybe
way to hard.

Rework `dape--live-connection' to filter connection based on
"connection type" at each point where connection has to be inferred
base guess on "type" and date of creation.
  • Loading branch information
svaante committed Feb 6, 2024
1 parent 1cb2327 commit d9b28ea
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 124 deletions.
7 changes: 4 additions & 3 deletions dape-tests.el
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Helper for `dape-test--with-files'."
;; Post test asserts
(progn
(dape-test--should
(not (dape--live-connection t)) 10)
(not (dape--live-connection 'parent t)) 10)
(dape-test--should
(not (seq-find (lambda (buffer)
(and (not (equal (buffer-name buffer)
Expand Down Expand Up @@ -126,7 +126,7 @@ Helper for `dape-test--with-files'."

(defun dape-test--stopped-p ()
"If current adapter connection is stopped."
(dape--stopped-threads (dape--live-connection t)))
(dape--live-connection 'stopped t))

(defun dape-test--debug (buffer key &rest args)
"Invoke `dape' interactivly with KEY and ARGS."
Expand Down Expand Up @@ -283,7 +283,8 @@ Expects line with string \"breakpoint\" in source."
(dape-test--should
(not (dape-test--line-at-regex "^ member")))
;; set value
(when (dape--capable-p (dape--live-connection t) :supportsSetVariable)
(when (dape--capable-p (dape--live-connection 'parent t)
:supportsSetVariable)
(dape-test--should
(dape-test--line-at-regex "^ a *0"))
(cl-letf (((symbol-function 'read-string)
Expand Down
Loading

0 comments on commit d9b28ea

Please sign in to comment.