]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve fontification in csharp-ts-mode (bug#59909)
authorJostein Kjønigsen <jostein@kjonigsen.net>
Thu, 8 Dec 2022 19:36:49 +0000 (20:36 +0100)
committerYuan Fu <casouri@gmail.com>
Sat, 10 Dec 2022 00:46:00 +0000 (16:46 -0800)
- 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

index d0465b26f05e641582f085f31783fda0d6043c63..8a7313b1ce8e5fd16ea158ea2aedcd3075392b7f 100644 (file)
@@ -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)))