From 4df35e3491cd82ff3ea08f05ded23cb89abadece Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jostein=20Kj=C3=B8nigsen?= Date: Thu, 8 Dec 2022 20:36:49 +0100 Subject: [PATCH] Improve fontification in csharp-ts-mode (bug#59909) - Fontity escape sequences. - Highlight syntax errors. * lisp/progmodes/csharp-mode.el (csharp-ts-mode--font-lock-settings) (csharp-ts-mode): Add new features --- lisp/progmodes/csharp-mode.el | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index d0465b26f05..8a7313b1ce8 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -818,7 +818,13 @@ compilation and evaluation time conflicts." :language 'c-sharp :feature 'delimiter - '((["," ":" ";"]) @font-lock-delimiter-face))) + '((["," ":" ";"]) @font-lock-delimiter-face) + + :language 'c-sharp + :feature 'escape-sequence + :override t + '((escape_sequence) @font-lock-escape-face + (ERROR) @font-lock-warning-face))) ;;;###autoload (add-to-list 'auto-mode-alist '("\\.cs\\'" . csharp-mode)) @@ -926,7 +932,7 @@ Key bindings: (setq-local treesit-font-lock-settings csharp-ts-mode--font-lock-settings) (setq-local treesit-font-lock-feature-list '(( comment definition) - ( keyword string type) + ( keyword string escape-sequence type) ( attribute constant expression literal) ( bracket delimiter))) -- 2.39.2