(defun eglot--update-doc (string hint)
"Put updated documentation STRING where it belongs.
Honours `eglot-put-doc-in-help-buffer'. HINT is used to
-potentially rename EGLOT's help buffer."
- (if (or (eq t eglot-put-doc-in-help-buffer)
- (and eglot-put-doc-in-help-buffer
- (funcall eglot-put-doc-in-help-buffer string)))
+potentially rename EGLOT's help buffer. If STRING is nil, the
+echo area cleared of any previous documentation."
+ (if (and string
+ (or (eq t eglot-put-doc-in-help-buffer)
+ (and eglot-put-doc-in-help-buffer
+ (funcall eglot-put-doc-in-help-buffer string))))
(with-current-buffer (eglot--help-buffer)
(let ((inhibit-read-only t)
(name (format "*eglot-help for %s*" hint)))
:success-fn (eglot--lambda ((Hover) contents range)
(unless sig-showing
(when-buffer-window
- (when-let (info (and (not (seq-empty-p contents))
- (eglot--hover-info contents
- range)))
- (eglot--update-doc info thing-at-point)))))
+ (eglot--update-doc (and (not (seq-empty-p contents))
+ (eglot--hover-info contents
+ range))
+ thing-at-point))))
:deferred :textDocument/hover))
(when (eglot--server-capable :documentHighlightProvider)
(jsonrpc-async-request