GNU bug report logs - #77421
[PATCH] [etags] Fix module definition with ::

Previous Next

Package: emacs;

Reported by: Laurent Stacul <laurent.stacul <at> gmail.com>

Date: Tue, 1 Apr 2025 00:15:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Eli Zaretskii <eliz <at> gnu.org>, Laurent Stacul <laurent.stacul <at> gmail.com>
Cc: 77421 <at> debbugs.gnu.org
Subject: bug#77421: [PATCH] [etags] Fix module definition with ::
Date: Wed, 2 Apr 2025 00:52:18 +0300
Hi!

On 01/04/2025 14:53, Eli Zaretskii wrote:
>> Or, if M already exists, we can also write:
>>
>>    module M::N; end
>>
>> With the later notation, the tag generated by etags will be M::N. When
>> browsing the code, using xref-find-definitions when the point is on N,
>> will not be able to find the definition of N because the implicit tag
>> name is M::N.
>>
>> This is the same problem with nested classes or even some rare
>> allowed definitions like explicitely defining a module/class from the
>> global namespace:
>>
>>    class ::A; end
>>
>> Solution: We need to give an explicit tag name. To achieve this, on
>> module/class definition we truncate the name to the last found column.
> Thanks.
> 
> Dmitry, any comments?

Yes, this all seems right.

This might have not come up before because this convention is relatively 
less popular, but the proposed change should be an improvement.




This bug report was last modified 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.