emacs-bug-tracker
[Top][All Lists]
Advanced

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

bug#61764: closed (29.0.60; eglot show incomplete inlay hints)


From: GNU bug Tracking System
Subject: bug#61764: closed (29.0.60; eglot show incomplete inlay hints)
Date: Tue, 05 Sep 2023 23:28:02 +0000

Your message dated Tue, 5 Sep 2023 16:27:36 -0700
with message-id 
<CADwFkmmYywQ8b13uSQy4=R2qZam5XgWnh9KE8W-77HAWBt8NCw@mail.gmail.com>
and subject line Re: control message for bug #61764
has caused the debbugs.gnu.org bug report #61764,
regarding 29.0.60; eglot show incomplete inlay hints
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
61764: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=61764
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: 29.0.60; eglot show incomplete inlay hints Date: Sat, 25 Feb 2023 01:10:19 +0800
The display of some inlay hints are not complete.  For example, in a
Rust source file:

  let v = vec![1i32];

The expected display is:

  let v: Vec<i32> = ...;

However, the current eglot (commit 55d29c9bacb in branch emacs-29) only
shows the semicolon:

  let v: = ...;

I found that the inlay hint returned by rust-analyzer is something like:

  ([(:value ": ") (:value "Vec" :location ...) (:value "<i32>")])

And I can confirm that by making the following change, the inlay hints
from rust-analyzer will be displayed correctly.

--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -3549,7 +3549,7 @@ eglot--update-hints-1
                   (left-pad (and paddingLeft (not (memq (char-before) '(32 
9)))))
                   (right-pad (and paddingRight (not (memq (char-after) '(32 
9)))))
                   (text (if (stringp label)
-                            label (plist-get (elt label 0) :value))))
+                            label (mapconcat (lambda (plist) (plist-get plist 
:value)) label))))
               (overlay-put ov 'before-string
                            (propertize
                             (concat (and left-pad " ") text (and right-pad " 
"))

According to the LSP spec [1], the intention of this design is to
support the use case where a LSP client shows different information for
each part.  Therefore, I believe this (concatenation) is the correct
thing to do, regardless of whether eglot supports hovering.

[1] 
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#inlayHint

Kai



--- End Message ---
--- Begin Message --- Subject: Re: control message for bug #61764 Date: Tue, 5 Sep 2023 16:27:36 -0700
Kai Ma <justksqsf@gmail.com> writes:

> fixed 61764 29.1
> quit

I assume that means you can no longer see the issue, so I'm closing this
bug.


--- End Message ---

reply via email to

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