emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 6c66dbd02c7 1/2: Turn on Eglot inlay hints by default


From: João Távora
Subject: emacs-29 6c66dbd02c7 1/2: Turn on Eglot inlay hints by default
Date: Sat, 4 Mar 2023 14:14:10 -0500 (EST)

branch: emacs-29
commit 6c66dbd02c7773a4347583b35b8caa219df30807
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Turn on Eglot inlay hints by default
    
    This is like any other server-provided feature, and may be turned off
    client-side by setting eglot-ignored-server-capabilities like
    
       (add-to-list 'eglot-ignored-server-capabilities :inlayHintProvider)
    
    * lisp/progmodes/eglot.el (eglot--maybe-activate-editing-mode):
    Activate eglot-inlay-hints-mode.
    (eglot-inlay-hints-mode): Instead of warning about missing
    :inlayHintProvider, turn off eglot-inlay-hints-mode.
---
 lisp/progmodes/eglot.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index 1f213d4e254..2491c86ea5b 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -1923,6 +1923,7 @@ If it is activated, also signal textDocument/didOpen."
       (eglot--signal-textDocument/didOpen)
       ;; Run user hook after 'textDocument/didOpen' so server knows
       ;; about the buffer.
+      (eglot-inlay-hints-mode 1)
       (run-hooks 'eglot-managed-mode-hook))))
 
 (add-hook 'after-change-major-mode-hook 'eglot--maybe-activate-editing-mode)
@@ -3646,8 +3647,7 @@ If NOERROR, return predicate, else erroring function."
   (cond (eglot-inlay-hints-mode
          (if (eglot--server-capable :inlayHintProvider)
              (jit-lock-register #'eglot--update-hints 'contextual)
-           (eglot--warn
-            "No :inlayHintProvider support. Inlay hints will not work.")))
+           (eglot-inlay-hints-mode -1)))
         (t
          (jit-lock-unregister #'eglot--update-hints)
          (remove-overlays nil nil 'eglot--inlay-hint t))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]