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: João Távora
Subject: Re: Adding support for xref jumping to headers/interfaces
Date: Sat, 11 Nov 2023 11:44:45 +0000

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.

> > 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.

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.

And then SLY would probably make the bag slightly different yet.

And every time you use Eglot to connect to a different LSP language
server you see a different bag of concepts yet again (but that's
not our fault).

So that sought-for consistency vanishes quickly.

So, I think that if what we want is ultimately to promote UI
consistency for programmers of different languages, we can come
up with xref.el helpers for major modes (and eglot.el) to help
achieve coordinate "a degree of consistency", as Spencer wishes.

But we have to note that full consistency is an utopia only fixed
by fixing the root problem, which is that languages are different,
and I think we don't want to "fix" that.

João



reply via email to

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