Browse Source

Send the current stack frame when requesting completion

* indium-client.el (indium-client-get-completion):
* indium-repl.el (indium-repl-get-completions): Send the current stack frame as
  part of the paylod.
tags/2.0.0
Nicolas Petton 1 year ago
parent
commit
3cc29fa143
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
2 changed files with 5 additions and 3 deletions
  1. +4
    -3
      indium-client.el
  2. +1
    -0
      indium-repl.el

+ 4
- 3
indium-client.el View File

@@ -172,12 +172,13 @@ When non-nil, evaluate CALLBACK with the result."
(when callback
(funcall callback (indium-remote-object-from-alist obj))))))

(defun indium-client-get-completion (expression &optional callback)
"Request the list of completion for EXPRESSION.
(defun indium-client-get-completion (expression &optional frame callback)
"Request the list of completion for EXPRESSION in the context of FRAME.
When non-nil, evaluate CALLBACK with the result."
(indium-client-send `((type . "runtime")
(payload . ((action . "getCompletion")
(expression . ,expression))))
(expression . ,expression)
(frameId . ,(when frame (indium-frame-id frame))))))
callback))

(defun indium-client-get-properties (id &optional callback)


+ 1
- 0
indium-repl.el View File

@@ -336,6 +336,7 @@ Evaluate CALLBACK with the completion candidates."
"this")))
(indium-client-get-completion
expression
indium-debugger-current-frame
(lambda (candidates)
(funcall callback
(seq-filter (lambda (candidate)


Loading…
Cancel
Save