emacs-devel
[Top][All Lists]
Advanced

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

Re: Adding support for xref jumping to headers/interfaces


From: Dmitry Gutov
Subject: Re: Adding support for xref jumping to headers/interfaces
Date: Mon, 6 Mar 2023 15:23:59 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1

On 06/03/2023 15:15, João Távora wrote:
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.

Could Eglot dynamically report on which of these operations are supported in the current buffer?



reply via email to

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