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

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

bug#61412: Inlay hints implementation


From: Dimitri Belopopsky
Subject: bug#61412: Inlay hints implementation
Date: Tue, 21 Feb 2023 19:42:19 +0100

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

Attachment: 0001-Add-inlay-hint-functionality.patch
Description: Text Data


reply via email to

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