On Mon, Mar 6, 2023 at 12:23 PM Felician Nemeth
<felician.nemeth@gmail.com> wrote:
Can you, please, consider adding more than just one new xref command?
The Language Server Protocol defines jump-to-declaration,
jump-to-implementation, and jump-to-typeDefinition commands as well.
----
I can image a new xref-find-extra command that provides a
`tmm-menubar'-like single key selection for the specific jump type. The
list of jump-types could be filled up by Eglot or major-modes (ada-mode
would add "specifications", ocaml-mode would add "interface"). If C-M-?
is bound to this new xref-find-extra, then "C-M-? i" would jump to the
interface definition in ada-mode, and "C-M-? d" would ask the LSP server
for declarations in case of Eglot.
(Users who find "C-M-?" awkward can rebind xref-find-extra to "s-.")
What do you think?
To me, the "find extra" trampoline idea sounds nice too. It doesn't
suffer from the drawback of adding "interface", "implementation",
"typeDefinition", "superSpecificLanguageConstruct" concepts to xref.el
in poorly-scalable fashion.