emacs-devel
[Top][All Lists]
Advanced

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

Re: Eglot "inlay hints" landed


From: Nikola Pajkovsky
Subject: Re: Eglot "inlay hints" landed
Date: Fri, 24 Feb 2023 12:03:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

João Távora <joaotavora@gmail.com> writes:

> 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?

What I have done for lsp-mode is that I have joined all labels from
`InlayHintsLabelPart`, and printed out the result.

That works like a charm but probably not the best solution.

>> 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.
>
> João



reply via email to

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