branch: externals/dape
commit cbfebf84e3fcce984c451bc6636ee49b93a7013e
Author: Daniel Pettersson <[email protected]>
Commit: Daniel Pettersson <[email protected]>
Improve REPL usage, enable REPL without any stopped threads #15
---
dape.el | 28 +++++++++++++---------------
1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/dape.el b/dape.el
index 3ac2906aca..1f4647c44d 100644
--- a/dape.el
+++ b/dape.el
@@ -959,9 +959,10 @@ CONTEXT which the result is going to be displayed in.
See `dape--callback' for expected CB signature."
(dape-request process
"evaluate"
- (list :frameId frame-id
- :expression expression
- :context context)
+ (append (when (dape--stopped-threads)
+ (list :frameId frame-id))
+ (list :expression expression
+ :context context))
cb))
(defun dape--scopes (process stack-frame cb)
@@ -2416,7 +2417,7 @@ interactively or if SELECT-BUFFER is non nil."
(call-interactively cmd)
(setq dape--repl-insert-text-guard nil))
;; Evaluate expression
- ((dape--stopped-threads)
+ (t
;; FIXME `dape--repl-insert-text-guard' is used here to not mess up
ordering
;; when running commands that will itself trigger output request
(setq dape--repl-insert-text-guard t)
@@ -2432,13 +2433,7 @@ interactively or if SELECT-BUFFER is non nil."
msg)
"\n\n"
dape--repl-prompt))
- (setq dape--repl-insert-text-guard nil))))
- (t
- (comint-output-filter
- dummy-process
- (format "* Unable to send \"%s\" no stopped threads *\n%s"
- input
- dape--repl-prompt))))))
+ (setq dape--repl-insert-text-guard nil)))))))
(defun dape--repl-completion-at-point ()
"Completion at point function for *dape-repl* buffer."
@@ -2469,10 +2464,13 @@ interactively or if SELECT-BUFFER is non nil."
(frame-id (plist-get (dape--current-stack-frame) :id)))
(dape--with dape-request (process
"completions"
- (list :frameId frame-id
- :text str
- :column column
- :line 1))
+ (append
+ (when (dape--stopped-threads)
+ (list :frameId frame-id))
+ (list
+ :text str
+ :column column
+ :line 1)))
(setq collection
(append
collection