bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#59897: 29.0.60; csharp-ts-mode: variable-name fontified as method wh


From: Yuan Fu
Subject: bug#59897: 29.0.60; csharp-ts-mode: variable-name fontified as method when invoking method with generic type-argument.
Date: Fri, 9 Dec 2022 13:07:28 -0800


> Your patch solves the issue described in the bug, but does not handle another 
> fontification error I discovered while
> testing my patch:
>
> SimpleGenericMethod<Type>(params);
>
> In the above example SimpleGenericMethod is fontified using 
> font-lock-type-face instead of
> font-lock-function-name-face. My patch fixes that case as well.
>
> As for which patch to choose:
>
> * From an objective perspective, the way I understand the code, your patch 
> overrides an existing fontification to apply
>  variable-name instead.
> * My patch however changes some selectors to be more specific selectors to 
> avoid fontifying the variable-identifier, and
>  also creates a new, highly-specific selector to fontify the variable-name 
> aspect as well.
>
> From a performance perspective, I would assume the latter approach is more 
> performant, but I don't know enough
> tree-sitter internals to say that with 100% confidence.
>
> Does anyone else know?

I don’t think the two approach would have significant difference. But I think
more specific pattern is definitely better in terms of code organization.

Yuan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]