Improve typescript-ts-mode fontification (bug#75824)

* lisp/progmodes/typescript-ts-mode.el:
(typescript-ts-mode--operators): Add syntax-highlighting ??
operator.
(typescript-ts-mode--font-lock-settings): Add "undefined" as
recognized constant.
This commit is contained in:
Jostein Kjønigsen 2024-10-16 09:52:08 +02:00 committed by Yuan Fu
parent 3a7809f9cc
commit a4a0957b6b
No known key found for this signature in database
GPG key ID: 56E19BC57664A442

View file

@ -188,7 +188,7 @@ Argument LANGUAGE is either `typescript' or `tsx'."
(defvar typescript-ts-mode--operators
'("=" "+=" "-=" "*=" "/=" "%=" "**=" "<<=" ">>=" ">>>=" "&=" "^="
"|=" "&&=" "||=" "??=" "==" "!=" "===" "!==" ">" ">=" "<" "<=" "+"
"|=" "&&=" "||=" "??" "??=" "==" "!=" "===" "!==" ">" ">=" "<" "<=" "+"
"-" "*" "/" "%" "++" "--" "**" "&" "|" "^" "~" "<<" ">>" ">>>"
"&&" "||" "!" "?.")
"TypeScript operators for tree-sitter font-locking.")
@ -271,7 +271,7 @@ Argument LANGUAGE is either `typescript' or `tsx'."
:feature 'constant
`(((identifier) @font-lock-constant-face
(:match "\\`[A-Z_][0-9A-Z_]*\\'" @font-lock-constant-face))
[(true) (false) (null)] @font-lock-constant-face)
[(true) (false) (null) (undefined)] @font-lock-constant-face)
:language language
:feature 'keyword