diff options
author | Yuan Fu <casouri@gmail.com> | 2022-12-28 16:57:21 -0800 |
---|---|---|
committer | Yuan Fu <casouri@gmail.com> | 2022-12-28 17:33:07 -0800 |
commit | 909091d7578b7225601b202fb9257dedae879e9a (patch) | |
tree | 83f1a13de9a6e211d3b58d1ba104df3d0ee65900 /lisp/progmodes/js.el | |
parent | e78e69b33189c653d1588b810283969ac3cca137 (diff) | |
download | emacs-909091d7578b7225601b202fb9257dedae879e9a.tar.gz |
; Minor cleanup for tree-sitter font-lock rules in js-ts-mode
* lisp/progmodes/js.el (js--treesit-font-lock-settings): Minor cleanup.
Diffstat (limited to 'lisp/progmodes/js.el')
-rw-r--r-- | lisp/progmodes/js.el | 12 |
1 files changed, 4 insertions, 8 deletions
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))) |