]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve typescript-ts-mode fontification (bug#75824)
authorJostein Kjønigsen <jostein@kjonigsen.net>
Wed, 16 Oct 2024 07:52:08 +0000 (09:52 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 3 Feb 2025 11:12:01 +0000 (12:12 +0100)
* 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.

(cherry picked from commit a4a0957b6b3b1db858524ac6d4dc3d951f65960b)

lisp/progmodes/typescript-ts-mode.el

index 9b2964c5faf03c93a0dad30a4be912d670673b43..7f81be05221bfe92d77254edf60cea8b40ebdf42 100644 (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