]> git.eshelyaron.com Git - emacs.git/commitdiff
Add expression for generic_name in csharp-ts-mode (bug#59897)
authorTheodor Thornhill <theo@thornhill.no>
Thu, 8 Dec 2022 10:08:28 +0000 (11:08 +0100)
committerYuan Fu <casouri@gmail.com>
Mon, 12 Dec 2022 23:08:54 +0000 (15:08 -0800)
Given the below example, we want 'services' to be font-locked in
'font-lock-variable-name-face' in all cases.  Previously this only
worked in the first case, and the other was font-locked as
'font-lock-function-name-face'.

namespace Foo {
    void Foo() {
        services.Add();
        services.Add<MyType>();
    }
}

* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Add new query that makes the mentioned example work.

lisp/progmodes/csharp-mode.el

index 8a7313b1ce8e5fd16ea158ea2aedcd3075392b7f..17b8ae53f84dc99941169819e16a1c8800c21c6c 100644 (file)
@@ -784,6 +784,10 @@ compilation and evaluation time conflicts."
      (invocation_expression
       (member_access_expression
        (generic_name (identifier) @font-lock-function-name-face)))
+     (invocation_expression
+      (member_access_expression
+       expression: (identifier) @font-lock-variable-name-face
+       name: (generic_name (type_argument_list (identifier)))))
      (invocation_expression
       (member_access_expression
        ((identifier) @font-lock-variable-name-face