[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree
From: |
Yuan Fu |
Subject: |
bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use |
Date: |
Thu, 17 Nov 2022 10:39:13 -0800 |
> On Nov 17, 2022, at 5:50 AM, Randy Taylor <dev@rjt.dev> wrote:
>
> On Wednesday, November 16th, 2022 at 22:39, Yuan Fu <casouri@gmail.com> wrote:
>
>>
>> Ah, for making you updating the patch for so many times! I just see this
>> report. The only comment I have is that I see you removed the field rule
>> from assignment feature:
>>
>
> No worries!
>
>>
>> - (assignment_expression
>> - left: (field_expression field: (_) @font-lock-property-face))
>>
>> I envisioned the assignment feature to highlight “the thing being assigned
>> to”, in which case it would highlight the field when it’s in LHS. It’s
>> perfectly fine to have both the field rule and the assignment rule to
>> highlight fields, I think. So if you don’t mind, I’d add it back to
>> assignment group.
>>
>
> I removed it because (field_identifier) @font-lock-property-face (in the
> property feature) highlights all fields, from what I can tell and have tested.
> Can you show me an example where it won't match?
>
> Below, when T is a struct:
>
> T thing;
> thing.b = thing.b;
> thing.b = 5;
>
> b is highlighted as a field in all cases.
Ah, the purpose of that rule is to highlight field names in the LHS of
assignments _only_. So if I disable property and enable assignment, I should
see normal field names not highlighted, but field names in LHS of assignments
highlighted.
>
> Also, I've attached an updated patch: it seems that the escape-sequence
> feature needs an override to work (probably because it's inside a string
> that's
> highlighted?).<0001-Utilize-new-font-lock-faces-for-C-C-and-Python-tree-.patch>
Thanks. I will add back the assignment field rule and apply, is that ok with
you?
Yuan
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use, Randy Taylor, 2022/11/14
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use, Randy Taylor, 2022/11/14
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use, Randy Taylor, 2022/11/15
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use, Randy Taylor, 2022/11/16
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use, Yuan Fu, 2022/11/16
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use, Randy Taylor, 2022/11/17
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use,
Yuan Fu <=
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use, Randy Taylor, 2022/11/17
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use, Yuan Fu, 2022/11/17
- bug#59268: [PATCH] Utilize new font-lock faces for C/C++ and Python tree-sitter use, Randy Taylor, 2022/11/17