Eglot: do not activate unsupported menu items

* lisp/progmodes/eglot.el (eglot-menu): Do not activate items that
the server does not support.
This commit is contained in:
Felicián Németh 2025-02-08 11:53:31 +01:00 committed by João Távora
parent 36c91fdacc
commit 3fde13a501

View file

@ -2311,8 +2311,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"