Subject: bug#59897: Acknowledgement (29.0.60; csharp-ts-mode: variable-name fontified as method when invoking method with generic type-argument.)

From: Jostein Kjønigsen <[email-masked]>
Date: Thu, 8 Dec 2022 11:09:08 +0100

And here's the patch to fix it.

*Jostein Kjønigsen*
jostein.kjønigsen.no <https://jostein.kjønigsen.no>
[email-masked] - [email-masked]
On 08.12.2022 10:30, GNU bug Tracking System wrote:
> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>   [email-masked]
>
> If you wish to submit further information on this problem, please
> send it [email-masked].
>
> Please do not send mail [email-masked]  unless you wish
> to report a problem with the Bug-tracking system.
>

From ab73c1ea068538e79b06012b912c02b0e961b841 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jostein=20Kj=C3=B8nigsen?= <[email-masked]>
Date: Thu, 8 Dec 2022 11:07:15 +0100
Subject: [PATCH] lisp/progmodes/csharp-mode.el: improve fontification in
 csharp-ts-mode

Fixes highlighting of generic methods like the one below:

instance.MethodWithTypeArguments<Type>(...);
InClassMethodWithTypeArguments<Type>(...);
---
 lisp/progmodes/csharp-mode.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 82e3bc0d541..12e45272551 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -791,7 +791,15 @@ csharp-ts-mode--font-lock-settings
      (invocation_expression
       (identifier) @font-lock-function-name-face)
      (invocation_expression
-      (member_access_expression (identifier) @font-lock-function-name-face))
+      (member_access_expression
+       expression: (identifier) @font-lock-variable-name-face))
+     (invocation_expression
+      function: [(generic_name (identifier)) @font-lock-function-name-face
+                 (generic_name (type_argument_list
+                                ["<"] @font-lock-bracket-face
+                                (identifier) @font-lock-type-face
+                                [">"] @font-lock-bracket-face)
+                               )])
 
      (catch_declaration
       ((identifier) @font-lock-type-face))
-- 
2.34.1