Obsolete eldoc-box-eglot-help-at-point
* eldoc-box.el (eldoc-box-eglot-help-at-point): Replace body with a single call to eldoc-box-help-at-point.
This commit is contained in:
parent
939724afef
commit
d0dd4e9d40
34
eldoc-box.el
34
eldoc-box.el
@ -623,35 +623,15 @@ You can use \[keyboard-quit] to hide the doc."
|
||||
|
||||
;;;; Eglot helper
|
||||
|
||||
(eval-and-compile
|
||||
(require 'jsonrpc)
|
||||
(when (require 'eglot nil t)
|
||||
(make-obsolete 'eldoc-box-eglot-help-at-point 'eldoc-box-help-at-point
|
||||
"v1.11.1")
|
||||
|
||||
(defvar eglot--managed-mode)
|
||||
(declare-function eglot--dbind "eglot.el")
|
||||
(declare-function eglot--hover-info "eglot.el")
|
||||
(declare-function eglot--current-server-or-lose "eglot.el")
|
||||
(declare-function eglot--TextDocumentPositionParams "eglot.el")
|
||||
(declare-function eglot--error "eglot.el")
|
||||
(declare-function jsonrpc-request "jsonrpc")
|
||||
|
||||
|
||||
(defun eldoc-box-eglot-help-at-point ()
|
||||
"Display documentation of the symbol at point."
|
||||
(defun eldoc-box-eglot-help-at-point ()
|
||||
"Display documentation of the symbol at point.
|
||||
This is now obsolete, you should use ‘eldoc-box-help-at-point’
|
||||
instead."
|
||||
(interactive)
|
||||
(when eglot--managed-mode
|
||||
(let ((eldoc-box-position-function #'eldoc-box--default-at-point-position-function))
|
||||
(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--help-at-point-last-point (point))
|
||||
(run-with-timer 0.1 nil #'eldoc-box--help-at-point-cleanup)))))
|
||||
(eldoc-box-help-at-point))
|
||||
|
||||
;;;; Comany compatibility
|
||||
;;
|
||||
|
Loading…
Reference in New Issue
Block a user