]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve fontification in csharp-ts-mode
authorJostein Kjønigsen <jostein@kjonigsen.net>
Mon, 28 Nov 2022 12:06:03 +0000 (13:06 +0100)
committerYuan Fu <casouri@gmail.com>
Mon, 28 Nov 2022 23:07:45 +0000 (15:07 -0800)
* lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings):
Improve rules for variables, new-expressions, and catch statements.

lisp/progmodes/csharp-mode.el

index 6712fcc57e2951704028fa754ebe476ebad50e62..3da3079f089eb8db84105545738bee3debdba48d 100644 (file)
@@ -743,7 +743,8 @@ compilation and evaluation time conflicts."
      ["operator"] @font-lock-type-face
      (type_parameter_constraints_clause
       target: (identifier) @font-lock-type-face)
-     (type_of_expression (identifier) @font-lock-type-face))
+     (type_of_expression (identifier) @font-lock-type-face)
+     (object_creation_expression (identifier) @font-lock-type-face))
    :language 'c-sharp
    :feature 'definition
    :override t
@@ -789,11 +790,20 @@ compilation and evaluation time conflicts."
      (invocation_expression
       (member_access_expression (identifier) @font-lock-function-name-face))
 
+     (catch_declaration
+      ((identifier) @font-lock-type-face))
+     (catch_declaration
+      ((identifier) @font-lock-type-face
+       (identifier) @font-lock-variable-name-face))
+
      (variable_declaration (identifier) @font-lock-type-face)
      (variable_declarator (identifier) @font-lock-variable-name-face)
 
      (parameter type: (identifier) @font-lock-type-face)
-     (parameter name: (identifier) @font-lock-variable-name-face))
+     (parameter name: (identifier) @font-lock-variable-name-face)
+
+     (binary_expression (identifier) @font-lock-variable-name-face)
+     (argument (identifier) @font-lock-variable-name-face))
    :language 'c-sharp
    :feature 'expression
    '((conditional_expression (identifier) @font-lock-variable-name-face)