]> git.eshelyaron.com Git - emacs.git/commitdiff
Eglot: do not activate unsupported menu items
authorFelicián Németh <felician.nemeth@gmail.com>
Sat, 8 Feb 2025 10:53:31 +0000 (11:53 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 9 Feb 2025 08:46:24 +0000 (09:46 +0100)
* lisp/progmodes/eglot.el (eglot-menu): Do not activate items that
the server does not support.

(cherry picked from commit 3fde13a5019bafbd2b1059e061a4b0869123564f)

lisp/progmodes/eglot.el

index 9e2385532167fedc57cb86fa15e067ef9661fea2..995d47a1306ca96124392304840ff89f884b7cbe 100644 (file)
@@ -2301,8 +2301,10 @@ If it is activated, also signal textDocument/didOpen."
     ["Quickfix" eglot-code-action-quickfix
      :visible (eglot-server-capable :codeActionProvider)]
     "--"
-    ["Show type hierarchy" eglot-show-type-hierarchy]
-    ["Show call hierarchy" eglot-show-call-hierarchy]
+    ["Show type hierarchy" eglot-show-type-hierarchy
+     :active (eglot-server-capable :typeHierarchyProvider)]
+    ["Show call hierarchy" eglot-show-call-hierarchy
+     :active (eglot-server-capable :callHierarchyProvider)]
     "--"))
 
 (easy-menu-define eglot-server-menu nil "Manage server communication"