emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-29 647b6a8099 1/9: Add expression for generic_name in csharp-ts-mo


From: Yuan Fu
Subject: emacs-29 647b6a8099 1/9: Add expression for generic_name in csharp-ts-mode (bug#59897)
Date: Mon, 12 Dec 2022 18:09:37 -0500 (EST)

branch: emacs-29
commit 647b6a8099f414e5a7b162efd3658e174064dfe7
Author: Theodor Thornhill <theo@thornhill.no>
Commit: Yuan Fu <casouri@gmail.com>

    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.
---
 lisp/progmodes/csharp-mode.el | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el
index 8a7313b1ce..17b8ae53f8 100644
--- a/lisp/progmodes/csharp-mode.el
+++ b/lisp/progmodes/csharp-mode.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]