* eldoc-box.el (eldoc-box-eglot-help-at-point): Don’t display nil.
This commit is contained in:
parent
c18023132d
commit
43ec41dcc0
@ -475,12 +475,15 @@ If (point) != last point, cleanup frame.")
|
|||||||
(interactive)
|
(interactive)
|
||||||
(when eglot--managed-mode
|
(when eglot--managed-mode
|
||||||
(let ((eldoc-box-position-function #'eldoc-box--default-at-point-position-function))
|
(let ((eldoc-box-position-function #'eldoc-box--default-at-point-position-function))
|
||||||
(eldoc-box--display
|
(let ((hover-info
|
||||||
(eglot--dbind ((Hover) contents range)
|
(eglot--dbind ((Hover) contents range)
|
||||||
(jsonrpc-request (eglot--current-server-or-lose) :textDocument/hover
|
(jsonrpc-request (eglot--current-server-or-lose) :textDocument/hover
|
||||||
(eglot--TextDocumentPositionParams))
|
(eglot--TextDocumentPositionParams))
|
||||||
(when (seq-empty-p contents) (eglot--error "No hover info here"))
|
(when (seq-empty-p contents) (eglot--error "No hover info here"))
|
||||||
(eglot--hover-info contents range))))
|
(eglot--hover-info contents range))))
|
||||||
|
(if hover-info
|
||||||
|
(eldoc-box--display hover-info)
|
||||||
|
(eglot--error "No hover info here"))))
|
||||||
(setq eldoc-box-eglot-help-at-point-last-point (point))
|
(setq eldoc-box-eglot-help-at-point-last-point (point))
|
||||||
(run-with-timer 0.1 nil #'eldoc-box--eglot-help-at-point-cleanup)))
|
(run-with-timer 0.1 nil #'eldoc-box--eglot-help-at-point-cleanup)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user