]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve fontification in csharp-ts-mode (bug#59897)
authorJostein Kjønigsen <jostein@kjonigsen.net>
Thu, 8 Dec 2022 10:07:15 +0000 (11:07 +0100)
committerYuan Fu <casouri@gmail.com>
Wed, 14 Dec 2022 22:30:52 +0000 (14:30 -0800)
Fixes highlighting of generic methods like the one below:

instance.MethodWithTypeArguments<Type>(...);
InClassMethodWithTypeArguments<Type>(...);

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Add new rule.

lisp/progmodes/csharp-mode.el

index dfe98cc49e63c40a1cc90f05b751c758f5171277..2d13ae6930c9778bad9afb6927ad678e464f5611 100644 (file)
@@ -791,7 +791,15 @@ compilation and evaluation time conflicts."
      (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))