branch: externals/eglot commit bd970be047aba4513c2970b9ff2d842f0472cb0e Author: jicksaw <jick...@pm.me> Commit: GitHub <nore...@github.com>
Fix #514: Reduce Eldoc noise from hover messages Also close #985 Only echo hover response content, without response range. LSP specification says the range is meant to visualize a hover. Maybe echoing the range is useful for some, but it seems non-standard behavior. Example issue: haskell-language-server responds with range set to whole file when hovering a comment -> Large, useless eldoc * eglot.el (eglot--hover-info): Remove text selected by range from output Copyright-paperwork-exempt: Yes --- eglot.el | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/eglot.el b/eglot.el index bde4a23f8e..b058183fb9 100644 --- a/eglot.el +++ b/eglot.el @@ -2711,13 +2711,10 @@ for which LSP on-type-formatting should be requested." (eglot--signal-textDocument/didChange) (eldoc))))))))) -(defun eglot--hover-info (contents &optional range) - (let ((heading (and range (pcase-let ((`(,beg . ,end) (eglot--range-region range))) - (concat (buffer-substring beg end) ": ")))) - (body (mapconcat #'eglot--format-markup - (if (vectorp contents) contents (list contents)) "\n"))) - (when (or heading (cl-plusp (length body))) (concat heading body)))) - +(defun eglot--hover-info (contents &optional _range) + (mapconcat #'eglot--format-markup + (if (vectorp contents) contents (list contents)) "\n")) + (defun eglot--sig-info (sigs active-sig sig-help-active-param) (cl-loop for (sig . moresigs) on (append sigs nil) for i from 0