GNU bug report logs - #59897
29.0.60; csharp-ts-mode: variable-name fontified as method when invoking method with generic type-argument.

Previous Next

Package: emacs;

Reported by: jostein <at> kjonigsen.net

Date: Thu, 8 Dec 2022 09:30:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.60

Done: Yuan Fu <casouri <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Yuan Fu <casouri <at> gmail.com>
To: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
Cc: jostein <at> kjonigsen.net, theo <at> thornhill.no, 59897 <at> debbugs.gnu.org
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




This bug report was last modified 2 years and 215 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.