Subject: Re: bug#78489: 30.1.50; Using etags, Ada and xref-find-definitions doesn't find definitions

From: Troy Brown <[email-masked]>
Date: Thu, 10 Jul 2025 21:26:30 -0400

On Sat, Jul 5, 2025 at 3:59 AM Eli Zaretskii <[email-masked]> wrote:
>
> > From: Stefan Monnier <[email-masked]>
> > Cc: Eli Zaretskii <[email-masked]>,  [email-masked]
> > Date: Tue, 24 Jun 2025 18:11:31 -0400
> >
> > Hi Troy,
> >
> > > For a mode-specific solution, I'm currently using the following.  It
> > > modifies the result of the completion table to remove the suffix, but
> > > stores the suffix as a text property on the candidate.  Then the text
> > > property is retrieved from within the annotation function to generate
> > > the appropriate suffix.  In this example, I chose to use a more
> > > descriptive suffix rather than reapplying the original one.  I'm also
> > > using the text property to drive additional "company-kind" information
> > > too.  This solution seems to be working well for me.
> >
> > That seems like a much better solution than my exit-function, indeed.
> >
> > I suggest adding it to `ada-mode` plus adding to `etag.el` a comment
> > pointing to that ada-mode` code.
> >
> > The `etags.el` comment is because `etags.el` now has partial support for
> > those `/X` annotations.  This partial support is used only for Ada
> > currently, but the way it's implemented in `etags.el` it can be used for
> > any language, so it could make sense in the future to move your code
> > into `etags.el`.
> >
> > Another option would be to put the code directly in `etags.el`, and make
> > it non-specific to Ada.  To reduce the cost of your wrapper, we could use
> > an `etags--found-slash-x-annotation` variable which is set whenever we
> > match the "/[...]" while reading the TAGS file, and then we only do the
> > extra dance when that var is non-nil.
>
> Ping!  Any further comments, or should I close this bug?

I'd be fine if someone wanted to make it more general.  There are
actually multiple Ada major modes available.  The ada-mode in ELPA is
currently unmaintained, but there are at least 3 alternatives that I'm
aware of (including my own ada-ts-mode).  The ideal solution is likely
one where everyone can benefit, but barring someone wanting to drive
this to a generalized conclusion, I'm fine with a mode-specific
solution.