unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "João Távora" <joaotavora@gmail.com>
To: Dimitri Belopopsky <dimitri@belopopsky.com>
Cc: Po Lu <luangruo@yahoo.com>,
	Chinmay Dalal <dalal.chinmay.0101@gmail.com>,
	Eli Zaretskii <eliz@gnu.org>,
	61412@debbugs.gnu.org
Subject: bug#61412: Inlay hints implementation
Date: Tue, 21 Feb 2023 21:26:21 +0000	[thread overview]
Message-ID: <CALDnm50FJn4NQb+uYVxYOBjhxYPBpdxNrONE=t6P9C67Pe2x3Q@mail.gmail.com> (raw)
In-Reply-To: <CA+46MXbbW60t=JccgKGX39jTkOu+i=GZhzSQsfnqBUPb-mnJWg@mail.gmail.com>

Ok, thanks.  While I'm sure Flymake can be used for this,
I'm not sure it should.  The reason is that inlay hints are,
in principle, much more numerous than diagnostics.  Collecting
all of them could be wasteful when the user is only looking at
a section of the file.  Flymake doesn't have very good
mechanisms to work with this scenario.

Anyway, your patch has a very large number of unrelated whitespace
changes, making it almost impossible to read.  Please make one
with only the essential changes.

João

On Tue, Feb 21, 2023 at 6:42 PM Dimitri Belopopsky
<dimitri@belopopsky.com> wrote:
>
> Hello,
>
> I thought the point was not to create overlays directly?
> I'm sharing what I currently have, using the flymake diagnostics directly.
> Maybe something can be salvaged?
>
> In the meantime I'll try out your patches.
>
> On Tue, 21 Feb 2023 at 16:14, João Távora <joaotavora@gmail.com> wrote:
>>
>> [Eli, I just noticed that this bug should be merged with 61066,
>> but I don't know how to do that]
>>
>> Hello,
>>
>> Attached is my implementation of inlay hints for Eglot.
>> Two patches are provided, where the first just lays some
>> basic groundwork to make the actual inlay hint implementation
>> simpler.
>>
>> Regarding copyright stuff, I did look at Chinmay's patch,
>> but I re-started from scratch.  While it was a very good
>> effort, there were too many idiomatic Elisp and Eglot things
>> to change.  I did take Chinmay's face definitions, though.
>> Not sure how to proceed here and if this counts as "derived
>> work" and if we should wait for Chinmay's copyright assignment.
>>
>> I gave it some light testing and I kind of like it.  Quite
>> helpful for C++ with clangd (the only server I tested it with).
>> You can bind `eglot-inlay-hint-mode` to some keybinding probably.
>
>
> It's even more helpful in languages like Rust, that rely on type deduction a lot more.
> Clangd has an extension for designator hints that looks interesting too.
>
>>
>> Documentation in the manual is still missing, but shouldn't
>> be very hard to do.
>>
>> Anyway, this is likely not the end of the inlay hint story
>> because, as the second patch documents, this is likely a
>> very naive implementation that always requests inlay hints
>> for the entire buffer even if just a fraction of it is visible.
>
>
>>
>> A better implementation would probably leverage
>> window-scroll-functions along with the Eglot-specific
>> idle timer.  That is probably much, much more tricky to get
>> right, but is also more than likely the way to go.
>>
>> In the meantime, I'd like your opinion on this patch and
>> the above topics first.
>>
>> João
>>
>> I hope gmail doesn't mess up my attachments...



-- 
João Távora





  reply	other threads:[~2023-02-21 21:26 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-11  8:13 bug#61412: [PATCH] Add inlay hints to eglot Chinmay Dalal
2023-02-11 11:50 ` Chinmay Dalal
2023-02-11 15:23 ` bug#61412: Question about implementation Chinmay Dalal
2023-02-13 15:35 ` bug#61412: Hover github discussion Chinmay Dalal
2023-02-15 13:58   ` Eli Zaretskii
2023-02-15 15:05     ` João Távora
2023-02-15 15:38       ` Eli Zaretskii
2023-02-15 12:56 ` bug#61412: [PATCH v2] Add inlay hints to eglot Chinmay Dalal
2023-02-15 13:08 ` bug#61412: [PATCH v3] " Chinmay Dalal
2023-02-15 16:24 ` bug#61412: Inlay activation Chinmay Dalal
2023-02-15 18:09   ` Eli Zaretskii
2023-02-15 18:48     ` Chinmay Dalal
2023-02-15 19:01       ` João Távora
2023-02-15 19:17         ` Chinmay Dalal
2023-02-15 19:41       ` Eli Zaretskii
2023-02-15 20:17         ` Chinmay Dalal
2023-02-21 15:13           ` bug#61412: Inlay hints implementation João Távora
2023-02-21 15:21             ` Eli Zaretskii
2023-02-21 18:42             ` Dimitri Belopopsky
2023-02-21 21:26               ` João Távora [this message]
2023-02-25  0:21                 ` João Távora
2023-02-25  7:59                   ` Eli Zaretskii
2023-02-25 10:19                     ` João Távora
2023-02-21 15:33 ` Chinmay Dalal
2023-02-21 15:57 ` Chinmay Dalal
2023-02-22 15:26 ` Chinmay Dalal
2023-02-22 16:51   ` Chinmay Dalal
2023-02-22 23:17   ` João Távora

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='CALDnm50FJn4NQb+uYVxYOBjhxYPBpdxNrONE=t6P9C67Pe2x3Q@mail.gmail.com' \
    --to=joaotavora@gmail.com \
    --cc=61412@debbugs.gnu.org \
    --cc=dalal.chinmay.0101@gmail.com \
    --cc=dimitri@belopopsky.com \
    --cc=eliz@gnu.org \
    --cc=luangruo@yahoo.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).