unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dimitri Belopopsky <dimitri@belopopsky.com>
To: "João Távora" <joaotavora@gmail.com>
Cc: Eli Zaretskii <eliz@gnu.org>, 61066@debbugs.gnu.org
Subject: bug#61066: [PATCH] Add inlay hint support to eglot
Date: Fri, 27 Jan 2023 19:44:42 +0100	[thread overview]
Message-ID: <CA+46MXY+VKrC-aoVB7SGutMAQ8B8ycnb773RWgOrG7qSxo7YsA@mail.gmail.com> (raw)
In-Reply-To: <CALDnm50xRQ_DzEo51DP5WgVWJo-kfN15ZCfEY7ARmKE3WzU5bw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3508 bytes --]

Hello,

I don't have much experience with hacking emacs, but I was thinking the
current code could also be reused
for the code lens LSP feature. Maybe there are other features that could be
done with the same kind
of setup?

This (to me anyway) would probably mean eldoc isn't the best option for a
more general solution.
Though I expect having overlays for eldoc would be beneficial as well.

I don't really know which is best between a library or integration inside
flymake. I might try out both
ideas, as I have no experience with either of them. My guess flymake sounds
easier to implement, but
a support library could probably be more flexible for reuse?

Dimitri

On Thu, 26 Jan 2023 at 13:29, João Távora <joaotavora@gmail.com> wrote:

> On Thu, Jan 26, 2023 at 6:28 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
>> > From: Dimitri Belopopsky <dimitri@belopopsky.com>
>> > Date: Wed, 25 Jan 2023 23:34:02 +0100
>> >
>> > I've been working on adding support for inlay hints inside eglot using
>> overlays.
>> > Here is a working patch, but I'm still missing a few things:
>> >
>> > - I can't figure out a way to show the hints on a document without
>> causing lags or timeouts from the lsp
>> > server
>> > - I'm currently updating the hints by sending the whole file each time
>> (to make sure all hints get updated
>> > correctly). I'm not sure on how to make this more efficient (or if it
>> even necessary).
>> >
>> > On the implementation side:
>> > - implemented with overlays as a minor model, enabled by default
>> > - shows all hints supported by the protocol
>> > - there is a customisation to disable the minor mode if the user
>> doesn't want the feature
>> >
>> > I'd love to get a few points to finish this patch, and of course any
>> ideas and feedbacks are welcome!
>>
>> Thank you for working on this important feature.
>>
>> AFAIU, inlay hints provide information of the same kind as ElDoc and
>> in similar manner from the display and UX POV.  So I think this
>> feature should work via ElDoc, not as a separate from-the-scratch
>> implementation.  ElDoc is already capable of using Eglot-supplied
>> information, so perhaps the only feature we need to add is the
>> capability of ElDoc to (optionally) display the information in
>> overlays near point.  (I thought we already had such a capability in
>> eldoc.el, but it looks like I was dreaming, because I cannot find it
>> there.)
>>
>> The advantage of basing this on ElDoc is that then we will be able to
>> provide similar features from information sources other than Eglot.
>>
>> João, WDYT?
>>
>
> I think you're mostly right in your analysis.  I also think this should be
> provided
> via some LSP-agnostic infrastructure and not as a separate
> from-the-scratch
> implementation, as you put it. This is (and was) also my stance in other
> similar
> matters.
>
> The devil is in the details, of course.  Is eldoc.el the right
> infrastructure
> for it. What augmentation does it need, if any?  Are these augmentations
> practical given the relative size, complexity and history of eldoc.el?
> Isn't
> an "inlay.el" or a "little-hint.el" support library a better choice? Or
> maybe
> flymake.el with it's use of overlay-based annotations is also acceptable
> here?  I don't (yet) have answers to these questions.
>
> Of course the existence of this prototype by Dimitri is certainly
> No Bad Thing and a good starting point.
>
> João
>

[-- Attachment #2: Type: text/html, Size: 4548 bytes --]

  reply	other threads:[~2023-01-27 18:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 22:34 bug#61066: [PATCH] Add inlay hint support to eglot Dimitri Belopopsky
2023-01-26  6:29 ` Eli Zaretskii
2023-01-26 12:30   ` João Távora
2023-01-27 18:44     ` Dimitri Belopopsky [this message]
2023-01-28  1:58   ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+46MXY+VKrC-aoVB7SGutMAQ8B8ycnb773RWgOrG7qSxo7YsA@mail.gmail.com \
    --to=dimitri@belopopsky.com \
    --cc=61066@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).