Subject: bug#69625: closed (Re: bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 06 Jul 2024 21:12:03 +0000

Your bug report

#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
69625: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69625
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum
From: Yuan Fu <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: Randy Taylor <[email-masked]>, [email-masked], Stefan Kangas <[email-masked]>, Dmitry Gutov <[email-masked]>
Date: Sat, 6 Jul 2024 14:10:12 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

> On Jul 6, 2024, at 1:05 AM, Eli Zaretskii <[email-masked]> wrote:
> 
>> Cc: Dmitry Gutov <[email-masked]>, Stefan Kangas <[email-masked]>,
>> [email-masked]
>> Date: Sat, 29 Jun 2024 19:08:47 +0000
>> From: Randy Taylor <[email-masked]>
>> 
>> On Saturday, June 29th, 2024 at 01:41, Yuan Fu <[email-masked]> wrote:
>>> 
>>> 
>>>> On Jun 28, 2024, at 8:03 PM, Stefan Kangas [email-masked] wrote:
>>>> 
>>>> Randy Taylor [email-masked] writes:
>>>> 
>>>>> Sounds good, we can consider an option if anyone complains.
>>>>> This is for master, right?
>>>> 
>>>> Yeah, it's probably too late for Emacs 30.
>>>> 
>>>> That said, if the patch is very small and/or trivial, and well-tested,
>>>> we sometimes make exceptions for important changes. I have no idea if
>>>> any of that would apply here, so I'm mentioning it for completion.
>>> 
>>> 
>>> I would apply it to master. So that people on master would have time to complain, if ever.
>>> 
>>> Yuan
>> 
>> We're on the same wavelength :).
> 
> Ping! Can we complete this by installing the patch, please?
> 
> I don't see any patches in this discussion.  If someone knows what is
> the patch, please either post it here or install on master.
> 
> Thanks.

I installed 2e9777512a0 to master.

Yuan

Subject: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum
From: Yuan Fu <[email-masked]>
To: Bug Report Emacs <[email-masked]>
Date: Thu, 7 Mar 2024 20:43:51 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

X-Debug-CC: [email-masked] <mailto:[email-masked]>

(I lied a little bit about on the [PATCH] part: I have a solution but didn’t turn it into a patch yet.)

The problem is follows: given the rust code below, some enum are not fontified with type face under font lock level 3, and those enum are fontified as function or variable under font lock level 4.

fn main() {
    func(MyEnum::VariantA(0));
    func(MyEnum::VariantB);
    func(VariantC);
    func(VariantD(0));
}

VariantA and VariantB are fontified correctly, but VariantC and VariantD are not.

I think a simple rule that fontifies every capitalized identifier would fix this. But I don’t know if that’ll create other problem. AFAIK capitalized identifier is always some type in rust, right?

This is first reported on rust-mode’s GitHub repo: https://github.com/rust-lang/rust-mode/issues/518

Yuan