Subject: Re: bug#79374: [PATCH] eglot: add support for semantic tokens

From: Philip Kaludercic <[email-masked]>
Date: Wed, 03 Sep 2025 08:01:18 +0000

"Lua V. R." <[email-masked]> writes:

[...]

> +(define-minor-mode eglot-semantic-tokens-mode
> +  "Minor mode for fontifying buffer with LSP server's semantic tokens."
> +  :global nil
> +  (cond (eglot-semantic-tokens-mode
> +         (if (eglot-server-capable :semanticTokensProvider)
> +             (jit-lock-register #'eglot--semtok-fontify 'contextual)
> +           (eglot-semantic-tokens-mode -1)))
> +        (t
> +         (jit-lock-unregister #'eglot--semtok-fontify)
> +         (with-silent-modifications
> +           (remove-list-of-text-properties (point-min) (point-max) '(font-lock-face))))))
> +
>  
>  ;;; Call and type hierarchies
>  (require 'button)
> @@ -4728,7 +5048,8 @@ If NOERROR, return predicate, else erroring function."
>  ;; harder. For now, use `with-eval-after-load'. See also github#1183.
>  (with-eval-after-load 'desktop
>    (add-to-list 'desktop-minor-mode-handlers '(eglot--managed-mode . ignore))
> -  (add-to-list 'desktop-minor-mode-handlers '(eglot-inlay-hints-mode . ignore)))
> +  (add-to-list 'desktop-minor-mode-handlers '(eglot-inlay-hints-mode . ignore))
> +  (add-to-list 'desktop-minor-mode-handlers '(eglot-semtok-mode . ignore)))
                                                 ^

As mentioned on Emacs-devel, shouldn't this be `eglot-semantic-tokens-mode'.

(Also, this is of course not a detailed review I just skimmed over the
code this morning, but for the most part it looks good!)

[...]

-- 
Philip Kaludercic