[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum
From: |
Stefan Kangas |
Subject: |
bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum |
Date: |
Sat, 22 Jun 2024 04:07:07 -0700 |
Yuan Fu <casouri@gmail.com> writes:
>> On Mar 14, 2024, at 6:52 PM, Dmitry Gutov <dmitry@gutov.dev> wrote:
>>
>> On 09/03/2024 05:50, Randy Taylor wrote:
>>> VariantA gets highlighted as a type and not a function at level 3 because
>>> that
>>> level doesn't support functions, but does support types. Maybe that could be
>>> considered a bug in that it shouldn't be highlighted at all for level 3?
>>
>> Probably.
>>
>>> I'm not sure how worth it would be to do something about that though, or how
>>> easy.
>>
>> Same. I haven't looked into it.
>>
>>> For VariantC, our (and tree-sitter's) best guess is that it's a variable.
>>> We can't really know it's a type without guessing - like assuming a
>>> capitalized
>>> identifier is a type, and I don't think that's something we can assume.
>>> People
>>> can have capitalized functions and variables even if that goes against
>>> Rust's
>>> usual style. Perhaps as a compromise we could introduce a variable (or
>>> something)
>>> that lets the user specify that all capitalized identifiers should be
>>> treated as
>>> types? Maybe it even makes sense to default it to that behaviour since I
>>> believe
>>> most Rust code follows that style.
>>
>> We do have some rules already that are based off whether an identifier is
>> capitalized. I.e. some for use_as_clause, and another for highlighting an
>> identifier with font-lock-constant-face if it's ALL_CAPS. So it might be
>> logical to carry on with that approach.
>>
>> If the style is consistent enough across the ecosystem, of course.
>>
>> We could add a variable too, but that'd make the rules more complex so it
>> would be helpful to understand first whether there are users who would
>> benefit.
>
> For some reason I couldn’t see Randy’s messages. So sorry if I missed
> anything. I suggest we go ahead with guessing and add the variable if enough
> people complain. Personally speaking I believe the vast majority of Rust
> community wouldn’t write Rust code with capitalized variable and
> non-capitalized types. The Rust community is very much inclined to the
> standard style, AFAICT.
Yuan, did you make any progress here?
- bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum,
Stefan Kangas <=
- bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum, Yuan Fu, 2024/06/22
- bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum, Randy Taylor, 2024/06/28
- bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum, Yuan Fu, 2024/06/28
- bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum, Randy Taylor, 2024/06/28
- bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum, Stefan Kangas, 2024/06/28
- bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum, Yuan Fu, 2024/06/29
- bug#69625: 30.0.50; [PATCH] rust-ts-mode doesn't fontify some enum, Randy Taylor, 2024/06/29