GNU bug report logs - #79406
[PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently

Previous Next

Package: emacs;

Reported by: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>

Date: Mon, 8 Sep 2025 08:36:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
Cc: 79406 <at> debbugs.gnu.org, casouri <at> gmail.com
Subject: bug#79406: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently
Date: Mon, 08 Sep 2025 14:14:32 +0300
> Cc: Yuan Fu <casouri <at> gmail.com>
> From: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
> Date: Mon, 8 Sep 2025 10:34:50 +0200
> 
> As I'm getting more and more accustomed to font-lock level differentiation between variable-declaration and variable-use, I spot more cases which I think should be fixed in csharp-ts-mode. I've also found some areas of fontification which has been omitted entirely.
> 
> This looks inconsistent, and I'm willing to call that a bug :)
> 
> Attached is a patch which addresses the following areas of csharp-ts-mode fontification:
> 
> - hightlight reserved keywords agressively, dont allow misuse as
>   variables etc (the compiler will fail!)
> - highlight lambda-valued variables as funtions
> - improve semantics of function/class annotations using attributes
>   (maps closer to using-something than declaring it). also: rename to
>   "attribute". "property" has a different, defined meaning in C#.
> - better highlight variable-use in different scenarios (function-calls,
>   if-statements, assignment-expressions, property-use, anonymous object
>   initializers)
> - better hight property-use (anonymous object initializers)

Are all of these appropriate for the default value of
treesit-font-lock-level?  I see that
csharp-ts-mode--font-lock-settings doesn't use the level at all -- is
that on purpose?




This bug report was last modified 2 days ago.

Previous Next


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