GNU bug report logs - #78130
[PATCH] 31.0.50; csharp-ts-mode does not highlight generic types correctly everywhere

Previous Next

Package: emacs;

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

Date: Tue, 29 Apr 2025 09:53:02 UTC

Severity: normal

Tags: patch

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

Bug is archived. No further changes may be made.

Full log


Message #16 received at 78130-done <at> debbugs.gnu.org (full text, mbox):

From: Yuan Fu <casouri <at> gmail.com>
To: Jostein Kjønigsen <jostein <at> secure.kjonigsen.net>
Cc: 78130-done <at> debbugs.gnu.org
Subject: Re: bug#78130: Acknowledgement ([PATCH] 31.0.50; csharp-ts-mode does
 not highlight generic types correctly everywhere)
Date: Thu, 1 May 2025 00:54:19 -0700

> On Apr 29, 2025, at 12:51 PM, Jostein Kjønigsen <jostein <at> secure.kjonigsen.net> wrote:
> 
> Attached is a better patch, which addresses a lot of different areas of C# fontification.
> 
> Overall I think these are pure improvements:
> 
> - fontification of generic types with namespace-prefixes
> - function-call parameters
> - variable use in string interpolation
> - implicitly typed parameters in lambda-expressions
> - index-expressions
> - variables used in return-statements
> - variables used in binary expressions
> 
> What might warrant some review is the use of the (:match) selector to identify local variables (as opposed to properties or types) for a more consistent fontification. This is the first time I'm using it, and I see there's some repetition in the implementation... Could this be improved somehow?
> 
> Do we have a "emacsy" way or convention to do this which I could have applied, or is it still a bit early wrt treesitter based modes?
> 

Great work! The use of :match seems legit to me. Rust-ts-mode has something similar for fortifying variable vs type, it doesn’t use it as many as here though. A bit strange for the grammar to put properties on identifier too. I don’t have any good idea for reducing the duplication. 

I applied the patch to master. Thanks!

Yuan



This bug report was last modified 18 days ago.

Previous Next


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