Add expression for generic_name in csharp-ts-mode (bug#59897)

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.
This commit is contained in:
Theodor Thornhill 2022-12-08 11:08:28 +01:00 committed by Yuan Fu
parent 5b178efd85
commit 647b6a8099
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View 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