From: Yuan Fu Date: Thu, 29 Dec 2022 00:57:21 +0000 (-0800) Subject: ; Minor cleanup for tree-sitter font-lock rules in js-ts-mode X-Git-Tag: emacs-29.0.90~929 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=909091d7578b7225601b202fb9257dedae879e9a;p=emacs.git ; Minor cleanup for tree-sitter font-lock rules in js-ts-mode * lisp/progmodes/js.el (js--treesit-font-lock-settings): Minor cleanup. --- diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 211d4d7d805..4dece11d1c1 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3479,20 +3479,17 @@ This function is intended for use in `after-change-functions'." (treesit-font-lock-rules :language 'javascript - :override t :feature 'comment - `((comment) @font-lock-comment-face) + '((comment) @font-lock-comment-face) :language 'javascript - :override t :feature 'constant - `(((identifier) @font-lock-constant-face + '(((identifier) @font-lock-constant-face (:match "^[A-Z_][A-Z_\\d]*$" @font-lock-constant-face)) [(true) (false) (null)] @font-lock-constant-face) :language 'javascript - :override t :feature 'keyword `([,@js--treesit-keywords] @font-lock-keyword-face [(this) (super)] @font-lock-keyword-face) @@ -3569,8 +3566,7 @@ This function is intended for use in `after-change-functions'." :language 'javascript :feature 'jsx - `( - (jsx_opening_element + '((jsx_opening_element [(nested_identifier (identifier)) (identifier)] @font-lock-function-name-face) @@ -3588,7 +3584,7 @@ This function is intended for use in `after-change-functions'." :language 'javascript :feature 'number - `((number) @font-lock-number-face + '((number) @font-lock-number-face ((identifier) @font-lock-number-face (:match "^\\(:?NaN\\|Infinity\\)$" @font-lock-number-face)))