diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index 5a669fdbd42..e2b748f6cb8 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3570,16 +3570,6 @@ js--treesit-font-lock-settings ;; full namespace import (* as alias) (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 @@ -3606,6 +3596,12 @@ js--treesit-font-lock-settings (jsx_self_closing_element name: (_) @font-lock-function-call-face) (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 @@ -3657,14 +3653,6 @@ js--fontify-template-string (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