mirror of
https://github.com/vale981/emacs-jupyter
synced 2025-03-05 23:41:38 -05:00
jupyter-repl--inspect
accepts the detail argument for inspect messages
This commit is contained in:
parent
55449c1d6a
commit
26c39c3d55
1 changed files with 7 additions and 4 deletions
|
@ -1669,7 +1669,7 @@ COMMAND and ARG have the same meaning as the elements of
|
||||||
(annotation (get-text-property 0 'annot arg))
|
(annotation (get-text-property 0 'annot arg))
|
||||||
(doc-buffer (let* ((inhibit-read-only t)
|
(doc-buffer (let* ((inhibit-read-only t)
|
||||||
(buf (jupyter-repl--inspect
|
(buf (jupyter-repl--inspect
|
||||||
arg (length arg) (company-doc-buffer)
|
arg (length arg) nil (company-doc-buffer)
|
||||||
company-async-timeout)))
|
company-async-timeout)))
|
||||||
(when buf
|
(when buf
|
||||||
(with-current-buffer buf
|
(with-current-buffer buf
|
||||||
|
@ -1679,11 +1679,14 @@ COMMAND and ARG have the same meaning as the elements of
|
||||||
|
|
||||||
;;; Inspection
|
;;; Inspection
|
||||||
|
|
||||||
(defun jupyter-repl--inspect (code pos &optional buffer timeout)
|
(defun jupyter-repl--inspect (code pos &optional detail buffer timeout)
|
||||||
"Send an inspect request to a Jupyter kernel.
|
"Send an inspect request to a Jupyter kernel.
|
||||||
CODE and POS are the code to send and the position within the
|
CODE and POS are the code to send and the position within the
|
||||||
code, respectively.
|
code, respectively.
|
||||||
|
|
||||||
|
If DETAIL is non-nil, it is the detail level of the inspect
|
||||||
|
request. Otherwise a detail level of 0 is used.
|
||||||
|
|
||||||
If BUFFER is non-nil then it should be the buffer in which to
|
If BUFFER is non-nil then it should be the buffer in which to
|
||||||
insert the inspection text returned from the kernel. After the
|
insert the inspection text returned from the kernel. After the
|
||||||
inserting the text into BUFFER, BUFFER is returned. If BUFFER is
|
inserting the text into BUFFER, BUFFER is returned. If BUFFER is
|
||||||
|
@ -1695,7 +1698,7 @@ respond before returning nil."
|
||||||
(let* ((jupyter-inhibit-handlers '(:status))
|
(let* ((jupyter-inhibit-handlers '(:status))
|
||||||
(msg (jupyter-wait-until-received :inspect-reply
|
(msg (jupyter-wait-until-received :inspect-reply
|
||||||
(jupyter-send-inspect-request jupyter-repl-current-client
|
(jupyter-send-inspect-request jupyter-repl-current-client
|
||||||
:code code :pos pos)
|
:code code :pos pos :detail detail)
|
||||||
timeout)))
|
timeout)))
|
||||||
(when msg
|
(when msg
|
||||||
(cl-destructuring-bind (&key status found data metadata &allow-other-keys)
|
(cl-destructuring-bind (&key status found data metadata &allow-other-keys)
|
||||||
|
@ -1729,7 +1732,7 @@ the `current-buffer' and display the results in a buffer."
|
||||||
;; would be to supply the buffer in which to insert text like what is
|
;; would be to supply the buffer in which to insert text like what is
|
||||||
;; done here, but how to make it more general for all insertion
|
;; done here, but how to make it more general for all insertion
|
||||||
;; types?
|
;; types?
|
||||||
(if (not (jupyter-repl--inspect code pos (current-buffer)))
|
(if (not (jupyter-repl--inspect code pos nil (current-buffer)))
|
||||||
(message "Inspect timed out")
|
(message "Inspect timed out")
|
||||||
;; TODO: Customizable action
|
;; TODO: Customizable action
|
||||||
(display-buffer (current-buffer))
|
(display-buffer (current-buffer))
|
||||||
|
|
Loading…
Add table
Reference in a new issue