Also close https://github.com/joaotavora/eglot/issues/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
GitHub-reference: fix https://github.com/joaotavora/eglot/issues/514
(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