1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00
emacs/lisp/progmodes
João Távora a542ed23e4 Eglot: re-do semantic tokens again (bug#79374)
After a week of intense testing, found out there were various insidious
bugs related to out-of-date requests that rear their heads in different
typing patterns.  One way to sort this out and still minimize the number
of requests is to have Eglot's semtok code be aware of the states a
request for tokens can be in: inexistent/invalid, unsent, sent, valid.

The needs and optimization opportunities for servers that support "full"
and "full/delta" requests are considerably different from the ones of
servers which only support "full" and "range".  The latter seem to be in
the minority, so for now I've removed the range requests.  These servers
should still work with "full" requests.

In a further bug, at least two servers (clangd and lean) were found to
plainly abuse the semanticTokens/refresh server request.  This confuses
the state logic.  The solution is to simply no-op this request handler,
it doesn't seem to do anything useful.

Finally, when auto-reverting with preserve-modes (as done by vc-revert
and auto-revert-mode), the font-lock state needs to be reinitialized.
Fixed this in eglot--after-revert-hook.

* lisp/progmodes/eglot.el (eglot-client-capabilities): Don't announce
ranged request support.
(eglot--docver): Rename from eglot--versioned-identifier.
(eglot--diagnostics)
(eglot--flymake-diagnostics)
(eglot-handle-notification)
(eglot--signal-textDocument/didOpen)
(eglot--report-to-flymake)
(eglot--apply-text-edits)
(eglot--VersionedTextDocumentIdentifier): Use eglot--docver.
(eglot--send-changes-hook): Rename from eglot--document-changed-hook.
(eglot--after-change): Don't run eglot--send-changes-hook here.
(eglot--signal-textDocument/didChange): Run it here.
(eglot--semtok-state): Rename from eglot--semtok-cache.
(eglot--semtok-inflight): Delete.
(eglot--handle-request semanticTokens/refresh): Nullify.
(eglot-semantic-tokens-mode): Tweak.
(eglot--semtok-after-send-changes): New hook.
(eglot--semtok-request)
(eglot--semtok-font-lock): Rewrite.
(eglot--after-revert-hook): Reinitialize semtok state.

Co-authored-by: Lua Viana Reis <me@lua.blog.br>
2025-11-28 21:32:20 +00:00
..
antlr-mode.el
asm-mode.el
autoconf.el
bat-mode.el
bug-reference.el (read-only-keymap-*): Be more careful with the namespace 2025-10-12 09:50:31 -04:00
c-ts-common.el Use documentation mark-up face for 'tag_name' node in document block. 2025-11-20 19:48:41 +02:00
c-ts-mode.el Check if treesit-major-mode-remap-alist is bound in ts-modes autoload forms 2025-10-16 09:45:30 +03:00
cc-align.el CC Mode: Don't indent a construct in a class after a template 2025-09-19 20:51:45 +00:00
cc-awk.el CC Mode: Remove workarounds for missing "\_<", "\_>" in XEmacs 2025-06-23 11:50:07 +00:00
cc-bytecomp.el
cc-cmds.el CC Mode: Remove workarounds for missing "\_<", "\_>" in XEmacs 2025-06-23 11:50:07 +00:00
cc-defs.el CC Mode: update Version: header. Add a comment about it 2025-11-25 12:00:55 +00:00
cc-engine.el ; * lisp/progmodes/cc-engine.el: Fix trailing whitespace. 2025-07-05 06:03:48 -04:00
cc-fonts.el CC Mode: Remove workarounds for missing "\_<", "\_>" in XEmacs 2025-06-23 11:50:07 +00:00
cc-guess.el
cc-langs.el CC Mode: Remove workarounds for missing "\_<", "\_>" in XEmacs 2025-06-23 11:50:07 +00:00
cc-menus.el CC Mode: Remove workarounds for missing "\_<", "\_>" in XEmacs 2025-06-23 11:50:07 +00:00
cc-mode.el CC Mode: update Version: header. Add a comment about it 2025-11-25 12:00:55 +00:00
cc-styles.el
cc-vars.el CC Mode: Don't indent a construct in a class after a template 2025-09-19 20:51:45 +00:00
cfengine.el
cl-font-lock.el
cmacexp.el
cmake-ts-mode.el Remove the cached values in tree-sitter modes (bug#79363) 2025-11-28 00:12:28 -08:00
compile.el loaddefs-gen: Weed out some elements from the shortcut path 2025-11-22 06:56:46 -05:00
cperl-mode.el ; cperl-mode.el: Do not warn with valid character escapes 2025-08-22 15:03:17 +02:00
cpp.el
csharp-mode.el Remove the cached values in tree-sitter modes (bug#79363) 2025-11-28 00:12:28 -08:00
cwarn.el
dcl-mode.el
dockerfile-ts-mode.el Check if treesit-major-mode-remap-alist is bound in ts-modes autoload forms 2025-10-16 09:45:30 +03:00
ebnf-abn.el
ebnf-bnf.el
ebnf-dtd.el
ebnf-ebx.el
ebnf-iso.el
ebnf-otz.el
ebnf-yac.el
ebnf2ps.el
ebrowse.el
eglot.el Eglot: re-do semantic tokens again (bug#79374) 2025-11-28 21:32:20 +00:00
elisp-mode.el ; (elisp-fontify-symbol): Put less text props when possible 2025-10-26 17:39:10 +01:00
elixir-ts-mode.el Improve hideshow support for elixir-ts-mode and heex-ts-mode 2025-11-10 20:46:40 +02:00
erts-mode.el
etags-regen.el Fix etags-regen-mode for remote projects (bug#79358) 2025-09-29 02:40:28 +03:00
etags.el
executable.el executable-interpret: Handle remote file names 2025-08-14 17:08:36 +02:00
f90.el hideshow: Rework previous changes 2025-11-08 20:04:30 +02:00
flymake-cc.el
flymake-proc.el
flymake.el Make Flymake fringe indicators use dedicated faces 2025-11-22 13:01:18 +02:00
fortran.el hideshow: Rework previous changes 2025-11-08 20:04:30 +02:00
gdb-mi.el Fix gdb-mi startup when asking user about debuginfod 2025-09-14 08:55:44 +03:00
glasses.el
go-ts-mode.el Cache compiled tree-sitter queries (bug#79363) 2025-10-20 22:12:35 -07:00
grep.el * lisp/progmodes/grep.el (grep-menu-map): Add "Edit Grep Buffer" (bug#79793). 2025-11-10 09:21:00 +02:00
gud.el "M-x lldb": bugfix source code location without column 2025-09-06 12:04:30 +03:00
heex-ts-mode.el Improve hideshow support for heex-ts-mode and yaml-ts-mode 2025-11-10 21:46:29 +02:00
hideif.el
hideshow.el ; hideshow: Rename 'hs--discard-overlay-after-change'. 2025-11-23 09:48:27 +02:00
icon.el hideshow: Rework previous changes 2025-11-08 20:04:30 +02:00
inf-lisp.el
java-ts-mode.el Fix fontification for var in java-ts-mode (bug#79626) 2025-11-02 14:17:23 -08:00
js.el Remove the cached values in tree-sitter modes (bug#79363) 2025-11-28 00:12:28 -08:00
json-ts-mode.el Check if treesit-major-mode-remap-alist is bound in ts-modes autoload forms 2025-10-16 09:45:30 +03:00
ld-script.el * lisp/progmodes/ld-script.el: Add 'PT_TLS' to 'ld-script-keywords'. 2025-11-08 19:17:56 +02:00
lua-mode.el Fix non-interactive use of 'lua-start-process' 2025-11-22 13:03:24 +02:00
lua-ts-mode.el Check if treesit-major-mode-remap-alist is bound in ts-modes autoload forms 2025-10-16 09:45:30 +03:00
m4-mode.el
make-mode.el
meta-mode.el
mixal-mode.el
modula2.el
octave.el
opascal.el
pascal.el
peg.el peg.el: Fix bug#79502 a bit more 2025-09-27 22:57:02 -04:00
perl-mode.el
php-ts-mode.el Remove the cached values in tree-sitter modes (bug#79363) 2025-11-28 00:12:28 -08:00
prog-mode.el Add tree-sitter version of prog-fill-reindent-defun (bug#78703) 2025-06-09 22:55:09 -07:00
project.el Fix project-prompt-project-name with (choose a dir) 2025-11-27 12:27:22 +02:00
prolog.el
ps-mode.el
python.el hideshow: Rework previous changes 2025-11-09 09:20:05 +02:00
ruby-mode.el Fix indentation of keyword argument arrays/hashes in ruby-mode 2025-11-26 01:31:12 +02:00
ruby-ts-mode.el Fix indentation of keyword argument arrays/hashes in ruby-mode 2025-11-26 01:31:12 +02:00
rust-ts-mode.el Check if treesit-major-mode-remap-alist is bound in ts-modes autoload forms 2025-10-16 09:45:30 +03:00
scheme.el (scheme-mode-variables): Fix bug#79282 2025-09-10 19:05:15 -04:00
sh-script.el Check if treesit-major-mode-remap-alist is bound in ts-modes autoload forms 2025-10-16 09:45:30 +03:00
simula.el
sql.el
subword.el
tcl.el
typescript-ts-mode.el Merge from origin/emacs-30 2025-11-15 07:21:32 -05:00
vera-mode.el
verilog-mode.el verilog-mode: Make recent change backward-compatible and update from package upstream. 2025-11-08 18:33:58 -05:00
vhdl-mode.el hideshow: Rework previous changes 2025-11-08 20:04:30 +02:00
which-func.el
xref.el Merge from origin/emacs-30 2025-10-18 06:15:46 -04:00
xscheme.el