emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/eglot2emacs f8c8c70f8a 077/120: Reduce eldoc noise from hover me


From: João Távora
Subject: feature/eglot2emacs f8c8c70f8a 077/120: Reduce eldoc noise from hover messages
Date: Thu, 20 Oct 2022 07:16:58 -0400 (EDT)

branch: feature/eglot2emacs
commit f8c8c70f8a7ec5649b5dd3f5af559f59eff65724
Author: jicksaw <jicksaw@pm.me>
Commit: GitHub <noreply@github.com>

    Reduce eldoc noise from hover messages
    
    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
---
 lisp/progmodes/eglot.el | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index bde4a23f8e..b058183fb9 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]