GNU bug report logs - #71070
30.0.50; c++-ts-mode namespace wrong fontification.

Previous Next

Package: emacs;

Reported by: Ergus <spacibba <at> aol.com>

Date: Sun, 19 May 2024 18:15:02 UTC

Severity: normal

Found in version 30.0.50

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 71070 <at> debbugs.gnu.org (full text, mbox):

From: Ergus <spacibba <at> aol.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: casouri <at> gmail.com, 71070 <at> debbugs.gnu.org
Subject: Re: bug#71070: 30.0.50; c++-ts-mode namespace wrong fontification.
Date: Sun, 19 May 2024 23:36:41 +0200
On Sun, May 19, 2024 at 10:13:45PM GMT, Eli Zaretskii wrote:
>> Date: Sun, 19 May 2024 21:00:42 +0200
>> From: Ergus <spacibba <at> aol.com>
>> Cc: Yuan Fu <casouri <at> gmail.com>, 71070 <at> debbugs.gnu.org
>>
>> >Why do you think std should be in font-lock-constant-face?  The name
>> >of a namespace is not a constant, it's an identifier.
>>
>> Hi Eli:
>>
>> That's how namespaces are fontified in the c++-mode. Not telling it is
>> correct, wrong or if needs improvement; just that c++-ts-mode is not
>> doing in the same way.
>>
>> Try this:
>>
>> ```main.cpp
>>
>> const std::string a;
>>
>> class myclass {
>> 	std::time::timespec var;
>> };
>>
>> int main()
>> {
>> 	std::string b = 1;
>>
>> 	
>> }
>> ```
>>
>> and then M-x c++-ts-mode you will see the difference.
>
>No one said that what c++-mode does is necessarily correct.  maybe it
>is, maybe it isn't.
>
>How do other C++ IDEs fontify namespace names?

Hi Eli:

Every editor-ide has its own approach for this. But emacs has it own
flavor and the ts-* intention was to keep it as close as possible to the
status-quo; that's why I am reporting it here.

There are many details missing in the c/c++-ts-mode compared to
c-mode... but I understand that some of them are WIP while others are
just too complex to port.

My main concern here is that this seemed like a simple issue considering
that treesitter recognizes the namespace correctly. But the Yuan's fix
didn't work; so maybe there is a detail we are missing here, or that
needs extra documentation? Or in the worst case some detail/issue broken
in the ts api?

Best,
Ergus




This bug report was last modified 1 year and 25 days ago.

Previous Next


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