diff options
author | Dmitry Gutov <dmitry@gutov.dev> | 2023-12-13 00:00:38 +0200 |
---|---|---|
committer | Dmitry Gutov <dmitry@gutov.dev> | 2023-12-13 00:00:38 +0200 |
commit | 400ef15bdc373b05e877cf0914f0fd5eda56cf1d (patch) | |
tree | 29f8d5a21b2f30051f02b7e36c219a7b28d1a95a /lisp/progmodes/js.el | |
parent | c165247c3009adec912abdf74d6d7d73c8c76c33 (diff) | |
download | emacs-400ef15bdc373b05e877cf0914f0fd5eda56cf1d.tar.gz emacs-400ef15bdc373b05e877cf0914f0fd5eda56cf1d.tar.bz2 emacs-400ef15bdc373b05e877cf0914f0fd5eda56cf1d.zip |
js-ts-mode: Fix font-lock rules conflict
* lisp/progmodes/js.el (js--treesit-font-lock-settings): Move
'property' to after 'jsx'. Stop using predicate (bug#67684).
(js--treesit-property-not-function-p): Delete.
Diffstat (limited to 'lisp/progmodes/js.el')
-rw-r--r-- | lisp/progmodes/js.el | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index aaf5779699b..c8d507c784b 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3581,16 +3581,6 @@ Check if a node type is available, then return the right indent rules." (import_clause (namespace_import (identifier) @font-lock-variable-name-face))) :language 'javascript - :feature 'property - '(((property_identifier) @font-lock-property-use-face - (:pred js--treesit-property-not-function-p - @font-lock-property-use-face)) - - (pair value: (identifier) @font-lock-variable-use-face) - - ((shorthand_property_identifier) @font-lock-property-use-face)) - - :language 'javascript :feature 'assignment '((assignment_expression left: (_) @js--treesit-fontify-assignment-lhs)) @@ -3611,6 +3601,12 @@ Check if a node type is available, then return the right indent rules." (jsx_attribute (property_identifier) @font-lock-constant-face)) :language 'javascript + :feature 'property + '(((property_identifier) @font-lock-property-use-face) + (pair value: (identifier) @font-lock-variable-use-face) + ((shorthand_property_identifier) @font-lock-property-use-face)) + + :language 'javascript :feature 'number '((number) @font-lock-number-face ((identifier) @font-lock-number-face @@ -3661,14 +3657,6 @@ OVERRIDE is the override flag described in (setq font-beg (treesit-node-end child) child (treesit-node-next-sibling child))))) -(defun js--treesit-property-not-function-p (node) - "Check that NODE, a property_identifier, is not used as a function." - (not (equal (treesit-node-type - (treesit-node-parent ; Maybe call_expression. - (treesit-node-parent ; Maybe member_expression. - node))) - "call_expression"))) - (defvar js--treesit-lhs-identifier-query (when (treesit-available-p) (treesit-query-compile 'javascript '((identifier) @id |