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: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
To: 79406 <at> debbugs.gnu.org
Cc: Yuan Fu <casouri <at> gmail.com>
Subject: bug#79406: [PATCH] 31.0.50; csharp-ts-mode does not fontify variable-use consistently
Date: Mon, 8 Sep 2025 10:34:50 +0200
[Message part 1 (text/plain, inline)]
Hey everyone.

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)

—
Kind Regards
Jostein Kjønigsen

[0001-csharp-ts-mode-fontification-fixes.patch (application/octet-stream, attachment)]

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.