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

From: Dmitry Gutov <[email-masked]>
Date: Sat, 9 Mar 2024 00:56:04 +0200

On 08/03/2024 06:43, Yuan Fu wrote:
> 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 might be more of an issue with highlighters order. As you can see, 
level 3 fontifies these as 'type' already, and does that because the 
identifiers are capitalized.

Some level 4 rules probably either come earlier than where they should 
be (thus applying before the ones with the "capitalized" matcher), or 
they should use a "not capitalized" matcher if moving them down would 
cause other problems.