* eldoc-box.el (eldoc-box-eglot-help-at-point): Don’t display nil.

This commit is contained in:
Bas Alberts 2022-03-30 01:02:16 -04:00 committed by Yuan Fu
parent c18023132d
commit 43ec41dcc0
No known key found for this signature in database
GPG Key ID: 56E19BC57664A442

View File

@ -475,12 +475,15 @@ If (point) != last point, cleanup frame.")
(interactive)
(when eglot--managed-mode
(let ((eldoc-box-position-function #'eldoc-box--default-at-point-position-function))
(eldoc-box--display
(let ((hover-info
(eglot--dbind ((Hover) contents range)
(jsonrpc-request (eglot--current-server-or-lose) :textDocument/hover
(eglot--TextDocumentPositionParams))
(when (seq-empty-p contents) (eglot--error "No hover info here"))
(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))
(run-with-timer 0.1 nil #'eldoc-box--eglot-help-at-point-cleanup)))