aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorJoão Távora2023-02-23 23:51:09 +0000
committerJoão Távora2023-02-24 02:14:44 +0000
commitb0cbd5590b238fa9001e3f07b7035704ef976722 (patch)
tree6ca0f6a45022893ccfdb0568dab4e496eeadbad1 /doc/misc
parent91e24c5b5a69495bcd706a5287c05bb5fd282700 (diff)
downloademacs-b0cbd5590b238fa9001e3f07b7035704ef976722.tar.gz
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 'doc/misc')
-rw-r--r--doc/misc/eglot.texi8
1 files changed, 0 insertions, 8 deletions
diff --git a/doc/misc/eglot.texi b/doc/misc/eglot.texi
index 38c6adaf131..eed9744b9f0 100644
--- a/doc/misc/eglot.texi
+++ b/doc/misc/eglot.texi
@@ -883,14 +883,6 @@ this map. For example:
883 (define-key eglot-mode-map (kbd "<f6>") 'xref-find-definitions) 883 (define-key eglot-mode-map (kbd "<f6>") 'xref-find-definitions)
884@end lisp 884@end lisp
885 885
886@item eglot-lazy-inlay-hints
887This variable controls the operation and performance of LSP Inlay
888Hints (@pxref{Eglot Features}). If non-@code{nil}, it specifies how
889much time to wait after a window is displayed or scrolled before
890requesting hints for that visible portion of a given buffer. If
891@code{nil}, inlay hints are always requested for the whole buffer,
892even for parts of it not currently visible.
893
894@end vtable 886@end vtable
895 887
896Additional variables, which are relevant for customizing the server 888Additional variables, which are relevant for customizing the server