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
This commit is contained in:
Jostein Kjønigsen 2022-12-08 20:36:49 +01:00 committed by Yuan Fu
parent 33a8415eb7
commit 4df35e3491
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View 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)))