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

From: Dmitry Gutov <[email-masked]>
Date: Mon, 2 Jun 2025 01:40:53 +0300

On 27/05/2025 14:43, Troy Brown via Bug reports for GNU Emacs, the Swiss 
army knife of text editors wrote:
> Assuming point is after "Disp" on line 9, I perform `M-x
> completion-at-point`.  In this example, there is only a single
> completion for this prefix in the TAGS file, thus it is automatically
> completed in the file buffer without displaying the*Completions*
> buffer.  After the completion, the buffer contents look like the
> following:
> 
> --8<---------------cut here---------------start------------->8---
> with Ada.Text_IO; use Ada.Text_IO;
> 
> procedure Hello_World is
>     procedure Display_Message is
>     begin
>        Put_Line ("Hello, World!");
>     end Display_Message;
> begin  -- Hello_World
>     Display_Message/p
> end Hello_World;
> --8<---------------cut here---------------end--------------->8---
> 
> As you can see above the "/p" suffix is added into the buffer as part
> of the completion.  This is not valid syntax.  I must therefore delete
> "/p" before adding the final semicolon.  This is what my suggested fix
> was attempting to address...preventing the insertion of the invalid
> suffix into the buffer.

This sounds very similar to the "kind" field in the extended Vi tags 
format, as described here: 
https://github.com/universal-ctags/ctags/blob/master/docs/man/tags.5.rst

(But also see 'man tags'.)

Which suggests that etags could grow such a field as well - if we're not 
migrating to the ctags format yet.