diff options
author | João Távora <joaotavora@gmail.com> | 2023-02-23 23:51:09 +0000 |
---|---|---|
committer | João Távora <joaotavora@gmail.com> | 2023-02-24 02:14:44 +0000 |
commit | b0cbd5590b238fa9001e3f07b7035704ef976722 (patch) | |
tree | 6ca0f6a45022893ccfdb0568dab4e496eeadbad1 /lisp/emacs-lisp/disass.el | |
parent | 91e24c5b5a69495bcd706a5287c05bb5fd282700 (diff) | |
download | emacs-b0cbd5590b238fa9001e3f07b7035704ef976722.tar.gz emacs-b0cbd5590b238fa9001e3f07b7035704ef976722.tar.bz2 emacs-b0cbd5590b238fa9001e3f07b7035704ef976722.zip |
Eglot: simplify inlay hints implementation with jit-lock
This implementation is much simpler than the one based on
windows-scroll-functions. It's also supposedly safer, as long as
jit-lock guarantees refontification of affected regions.
It's not _trivially_ simple though, as simply adding
'eglot--update-hints-1' to jit-lock-functions, while possible, is
going to request inlay hints from the LSP server for many small
regions of the buffer, depending on what jit-lock thinks is best. So
we keep coalescing these into a larger region until the time is
suitable for a more bandwidth-efficient request.
To do this, we use a jit-lock implementation detail,
jit-lock-context-unfontify-pos, which is a proxy for knowing that the
jit-lock-context-timer has run. Not sure how brittle it is, but it
seems to work reasonably.
We also get rid of the previous "get hints for entire buffer"
implementation.
* doc/misc/eglot.texi (Eglot Variables): Remove mention
to deleted eglot-lazy-inlay-hints.
* lisp/progmodes/eglot.el (eglot-lazy-inlay-hints)
(eglot--inlay-hints-after-scroll)
(eglot--inlay-hints-fully)
(eglot--inlay-hints-lazily): Remove.
(eglot--update-hints): Add function.
(eglot-inlay-hints-mode): Simplify.
Diffstat (limited to 'lisp/emacs-lisp/disass.el')
0 files changed, 0 insertions, 0 deletions