From: "João Távora" <joaotavora@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>,
dalal.chinmay.0101@gmail.com, emacs-devel@gnu.org,
dimitri@belopopsky.com, luangruo@yahoo.com
Subject: Re: Eglot "inlay hints" landed
Date: Fri, 24 Feb 2023 02:28:09 +0000 [thread overview]
Message-ID: <CALDnm53M3q_n2fNOtzdHGU6wn5EutvVD0Cw9=J-caKpZv-g58w@mail.gmail.com> (raw)
In-Reply-To: <jwvlekndgy1.fsf-monnier+emacs@gnu.org>
On Fri, Feb 24, 2023 at 1:08 AM Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> In your case, I suspect for the affected language servers there's not much
> more we can do but to say that the whole buffer's inlays need to be
> recomputed after a change.
I'd really like to avoid that. If it comes to that, and the problem
really is annoying enough (it might not be, and inlay hints are usually
a best-effort thing by the servers themselves) then I think going back
to the window-scroll-functions might be a better option. It doesn't have this
problem.
> > To do this, we use a jit-lock implementation detail,
> > jit-lock-context-unfontify-pos, which tells us that the contextual
> > fontification has just finished. Not sure how brittle it is, but it
> > seems to work reasonably.
>
> I think it won't work reliably in the case where the "immediate"
> jit-lock refresh happens to cover everything until window-end (e.g. we
> just inserted chunk of text that ends after window-end). In that case
> the jit-lock-context thingy will just mark the rest of the buffer as
> "not fresh" but won't call your fontification function at all.
Yes, I noticed something like that: many immediate small jit lock calls
where the condition was true.
> [ And of course, there are also those few rare modes that don't use
> jit-lock-context at all. ]
>
> I think using your own timer is probably the better option. I'd
> make it wait for `eglot-lazy-inlay-hints` rather than (+
> eglot-lazy-inlay-hints jit-lock-context-time), but I'd give it as
> default value a value computed from `jit-lock-context-time`.
Using a timer is necessary, but I've found that a 0-second timer is
sufficient to coalesce "well". But we only fire the timer if
the "unfontify-pos == point-max" condition is met. Then we don't
need to compete with jit-lock-context-timer, which is really the part I found
very bad.
I've pushed this last version to emacs-29. Have a look there,
please. And thanks for the insight!
João
next prev parent reply other threads:[~2023-02-24 2:28 UTC|newest]
Thread overview: 72+ 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
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-22 19:42 ` Eglot "inlay hints" landed João Távora
2023-02-23 1:45 ` [SPAM UNSURE] " Stephen Leake
2023-02-23 5:29 ` Chinmay Dalal
2023-02-23 6:31 ` Eli Zaretskii
2023-02-23 9:55 ` Chinmay Dalal
2023-02-23 10:03 ` João Távora
2023-02-23 10:55 ` Dimitri Belopopsky
2023-02-23 11:07 ` João Távora
2023-02-23 12:03 ` João Távora
2023-02-23 13:25 ` Dimitri Belopopsky
2023-02-23 11:05 ` Eli Zaretskii
2023-02-23 11:23 ` João Távora
2023-02-23 12:36 ` Eli Zaretskii
2023-02-23 12:57 ` João Távora
2023-02-23 14:48 ` Eli Zaretskii
2023-02-23 16:09 ` João Távora
2023-02-23 17:17 ` Eli Zaretskii
2023-02-23 17:46 ` João Távora
2023-02-23 18:01 ` Eli Zaretskii
2023-02-23 19:26 ` João Távora
2023-02-23 19:54 ` Eli Zaretskii
2023-02-23 20:03 ` João Távora
2023-02-23 19:27 ` Stefan Monnier
2023-02-23 19:39 ` João Távora
2023-02-23 19:53 ` Stefan Monnier
2023-02-23 20:09 ` João Távora
2023-02-23 22:19 ` Stefan Monnier
2023-02-23 23:59 ` João Távora
2023-02-24 1:08 ` Stefan Monnier
2023-02-24 2:28 ` João Távora [this message]
2023-02-24 7:35 ` Eli Zaretskii
2023-02-24 10:42 ` João Távora
2023-02-24 11:33 ` Eli Zaretskii
2023-02-24 12:26 ` João Távora
2023-02-23 10:17 ` Tassilo Horn
2023-02-23 12:55 ` Chinmay Dalal
2023-02-23 19:50 ` Nikola Pajkovsky
2023-02-23 21:35 ` João Távora
2023-02-23 21:45 ` Nikola Pajkovsky
2023-02-24 4:20 ` Chinmay Dalal
2023-02-24 5:04 ` Chinmay Dalal
2023-02-24 9:59 ` João Távora
2023-02-24 11:03 ` Nikola Pajkovsky
2023-02-27 22:50 ` Johann Klähn
2023-02-21 15:33 ` bug#61412: Inlay hints implementation 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALDnm53M3q_n2fNOtzdHGU6wn5EutvVD0Cw9=J-caKpZv-g58w@mail.gmail.com' \
--to=joaotavora@gmail.com \
--cc=dalal.chinmay.0101@gmail.com \
--cc=dimitri@belopopsky.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=luangruo@yahoo.com \
--cc=monnier@iro.umontreal.ca \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.