|
From: | Dmitry Gutov |
Subject: | Re: Adding support for xref jumping to headers/interfaces |
Date: | Sat, 11 Nov 2023 23:37:17 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 |
On 11/11/2023 13:44, João Távora wrote:
On Sat, Nov 11, 2023 at 12:58 AM Dmitry Gutov <dmitry@gutov.dev> wrote:On 09/11/2023 22:44, João Távora wrote:So I thought, that about 6 months ago we had established that "definition" and "reference" are two relatively safe concept to keep in xref.el, but other concepts should not be in there, because this doesn't scale well and could imposes awkward structure and hacks into an unknown number of backends. Has everyone changed their mind?My impression is that the first feedback from our patches actually made people excited about things that _weren't_ included in the previously-discussed plan, so it seems like a good idea to re-evaluate it. Though not necessarily redo it all. Though I guess this particular mailing list might be biased in favor of particular type of users (keyboard-driven, faster interaction as a priority).yeah, the sample size is so small that's it's more than certainly biased.
Most likely. It's too bad our actual audience here is quite small, and we don't have other reliable ways to collect feedback to prototypes.
Dropping an implementation into master is one way to test out a hypothesis, but it has inherent problems: the feedback comes late anyway, and quite often we'd end up having to maintain half-bakes features or unfortunate capabilities this way simply because they had been added and time had passed.
What exactly bothers you about eglot-find-declaration/implementation/typeDefinition? In LSP-land these concepts_do_ make sense, because the LSP standard prescribes what servers should do with them.I think we've actually discovered that these kind of make sense for Elisp too. They might not match the current implementation, but conceptually, in some future, they might.Yeah, they "kind of" make sense, but not very well and IMHO that's not a detail, but a big red flag. It's clear, and I understand your point, that if we were to squint to contort to them we could have xref provide a consistent "works everywhere" UI. But as Spencer noted it would be "works _mostly_ everywhere". And, as I noted, the contortion might lead us up awkward alley, such as finding a list mixing `declare-function` and `declare (compiler-macro` in the bag of xref-find-declarations.
Why contort? From where I'm standing, declarations/implementations/typeDefinitions apply to almost any object-oriented language (C++/Java/Ruby/Python/JS), and even some functional ones.
Declarations might be less of a thing in some of those (mostly dynamic ones), but overall the list even makes a certain sense for Elisp (and similarly CL, I guess), at least in the OOP parts of them. And where they don't, one or two of these commands will fail to work, big deal.
What's the alternative? To have many similar commands ruby-find-implementation c++-find-implementations python-find-implementations js-find-implementationsthat all do the same thing inside: call the Xref backend's "find implementations" mechanism? It will be especially great to use if some major mode authors bind that command to one key, and others to another.
And Spencer even wanted to put cl-defgeneric in that bag, which I can fully understand, as cl-defgeneric can also be viewed as a declaration. But its a completely different concept from those two.
If Elisp doesn't have any other kind of declarations, what is the worry? Let's put the ones it has.
Elisp's bag is different in that it will have separate kinds for faces/features/methods and, potentially, variables as well. But those are already in find-func.el and don't need new bindings.
[Prev in Thread] | Current Thread | [Next in Thread] |