[Top][All Lists]

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

Re: Eglot "inlay hints" landed

From: João Távora
Subject: Re: Eglot "inlay hints" landed
Date: Fri, 24 Feb 2023 09:59:29 +0000

On Fri, Feb 24, 2023 at 4:30 AM Chinmay Dalal
<dalal.chinmay.0101@gmail.com> wrote:

> You can look at the end of any long rust function with hl-line-mode on:
> there's an empty overlay but it's supposed to have a link to the
> beginning of the function. Screenshot attached.
> I think the bug is in eglot--update-hints-1:
> (if (stringp label) label (plist-get label :value))
> It should instead be the value of :value from the _first element_ of
> label, as the spec says a label is a string or a _list of_ 
> `InlayHintLabelPart`s:

Nice catch!  Indeed I missed that.

> Of course, this is not ideal when there are multiple elements in the
> label list (but not strictly wrong either).

Yeah, for now let's stick to the first.  I don't know how to interpret
"multiple hints" for the same "language element", in Emacs at least.
What do other editors do?

> Also, can the clickable link be actually implemented using the `keymap`
> property of overlays:
> https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Properties.html#index-keymap-of-character
> instead of just displaying the text?

Probably yes.


reply via email to

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