lisp/progmodes/csharp-mode.el: Fix fontification of typeof (bug#75406).

This commit is contained in:
Jostein Kjønigsen 2025-01-06 15:08:36 +01:00 committed by Eli Zaretskii
parent 3a5aba81ca
commit 0ef78b131b

View file

@ -748,6 +748,12 @@ compilation and evaluation time conflicts."
(treesit-query-compile 'c-sharp "(type_of_expression)" t)
t))
(defun csharp-ts-mode--test-typeof-expression ()
"Return non-nil if (type_of_expression) is in the grammar."
(ignore-errors
(treesit-query-compile 'c-sharp "(typeof_expression)" t)
t))
(defun csharp-ts-mode--test-name-equals ()
"Return non-nil if (name_equals) is in the grammar."
(ignore-errors
@ -871,7 +877,9 @@ compilation and evaluation time conflicts."
(type_parameter_constraint (type type: (generic_name (identifier) @font-lock-type-face)))))
,@(when (csharp-ts-mode--test-type-of-expression)
'((type_of_expression (identifier) @font-lock-type-face))
'((type_of_expression (identifier) @font-lock-type-face)))
,@(when (csharp-ts-mode--test-typeof-expression)
'((typeof_expression (identifier) @font-lock-type-face)))
(object_creation_expression