From 7336520fe774f7f7f5209c884e04911514bae796 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jostein=20Kj=C3=B8nigsen?= Date: Mon, 28 Nov 2022 13:06:03 +0100 Subject: [PATCH] Improve fontification in csharp-ts-mode * 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 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 6712fcc57e2..3da3079f089 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -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) -- 2.39.2