|
| From: | Dmitry Gutov |
| Subject: | Re: Adding support for xref jumping to headers/interfaces |
| Date: | Mon, 27 Nov 2023 16:35:11 +0200 |
| User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
On 26/11/2023 22:37, João Távora wrote:
On Sun, Nov 26, 2023 at 8:15 PM Dmitry Gutov <dmitry@gutov.dev> wrote:Eglot's integration shows that we don't in advance know whether a backend actually supports a specific kind. At least, we cannot know whether that kind is supported for a specific symbol at a given position (my tests with Eglot in the Emacs repo and clangd more than often ended up in "nothing found"). So to provide a list like ("definition/A" "documentation/B" ...) we'd have to first query all available backends about all kinds for the symbol at point. I think somebody said that this can be slow at least for some kind/backend/ls combinations.Who? Was it me? If so (I don't think so), I take it back. This is absolutely fine. Eglot takes this list, from the capabilities reported at the start of the LSP session and is very fast.
What I'm saying is that *actually fetching* those might be slow (allegedly) for some combinations of kind/backend/ls.
And to implement the kind of fallback Felician described, it seems we would first have to know what actual kinds of definitions are available for a given reference before providing the aforementioned. For optimal user experience, at least.
The Elisp backend actually does that (only show the applicable kinds), but Eglot returns a fixed list for all symbols.
2. Whether Eglot should, in time, deprecate its corresponding three commands if Xref adds its own versions.I think one of João's design goals of Eglot is to rely on existing Emacs features as much as possible.That was my expectation indeed, but lately he said that since the commands are already in Eglot, they will remain there.This is not my argument, as you well know.
It was one of your explanations, among others, and it was one that I understood best.
But one of the latest emails mentioned a separate Xref backend for c/c++ -- should I assume that every such backend would define its own set of *-find-* commands suitable for its languages?
Would such backends each come with an automatically-enabled keymap? Or would the user have to set up key bindings for every such command, for every special backend like that?
| [Prev in Thread] | Current Thread | [Next in Thread] |