diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2023-02-25 06:30:14 +0100 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2023-02-25 06:30:14 +0100 |
commit | 50b55656b9c5ce0d7940bec245f2d9725378d0a0 (patch) | |
tree | 851e86ebecbdf9a1ae767f9242415aa29ff3ae1e /lisp/progmodes/js.el | |
parent | a129f257720dbef9adcaff58862d45ac142f93f6 (diff) | |
parent | 5cf50d60041c82deccc4b32a8ecdb1a28b6e8f91 (diff) | |
download | emacs-50b55656b9c5ce0d7940bec245f2d9725378d0a0.tar.gz |
Merge from origin/emacs-29
5cf50d60041 Check the anchor along with the offset in treesit-indent-...
497018dd5c3 ; Fix typos in docstrings in c-ts-common.el
03072bbdd38 ; Set indent-tabs-mode to nil in c-ts-mode indent preproc...
4a25fa4586c Align to prev sibling for c-ts-mode indentation
d25f24fe57b Fix c-ts-common-statement-offset and c-ts-common--node-is
c92360c7a3b typescript-ts-mode: Highlight non-shorthand destructuring...
a795c51f605 Add more/finer faces for tree-sitter
146bce49321 Avoid crashes in batch mode due to lack of frame face cache
244a73cd729 Add Tramp version integrated in Emacs 28.3
# Conflicts:
# etc/NEWS
Diffstat (limited to 'lisp/progmodes/js.el')
-rw-r--r-- | lisp/progmodes/js.el | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el index dc49d7e818c..93298f4fb6e 100644 --- a/lisp/progmodes/js.el +++ b/lisp/progmodes/js.el @@ -3544,11 +3544,10 @@ This function is intended for use in `after-change-functions'." value: [(function) (arrow_function)]) (variable_declarator - name: (array_pattern - (identifier) - (identifier) - @font-lock-function-name-face) - value: (array (number) (function))) + name: [(array_pattern (identifier) @font-lock-variable-name-face) + (object_pattern + (shorthand_property_identifier_pattern) @font-lock-variable-name-face)]) + ;; full module imports (import_clause (identifier) @font-lock-variable-name-face) ;; named imports with aliasing @@ -3564,15 +3563,13 @@ This function is intended for use in `after-change-functions'." :language 'javascript :feature 'property - '(((property_identifier) @font-lock-property-face + '(((property_identifier) @font-lock-property-ref-face (:pred js--treesit-property-not-function-p - @font-lock-property-face)) - - (pair value: (identifier) @font-lock-variable-name-face) + @font-lock-property-ref-face)) - ((shorthand_property_identifier) @font-lock-property-face) + (pair value: (identifier) @font-lock-variable-ref-face) - ((shorthand_property_identifier_pattern) @font-lock-property-face)) + ((shorthand_property_identifier) @font-lock-property-ref-face)) :language 'javascript :feature 'assignment @@ -3582,14 +3579,14 @@ This function is intended for use in `after-change-functions'." :language 'javascript :feature 'function '((call_expression - function: [(identifier) @font-lock-function-name-face + function: [(identifier) @font-lock-function-call-face (member_expression property: - (property_identifier) @font-lock-function-name-face)]) + (property_identifier) @font-lock-function-call-face)]) (method_definition name: (property_identifier) @font-lock-function-name-face) (function_declaration - name: (identifier) @font-lock-function-name-face) + name: (identifier) @font-lock-function-call-face) (function name: (identifier) @font-lock-function-name-face)) @@ -3597,15 +3594,15 @@ This function is intended for use in `after-change-functions'." :feature 'jsx '((jsx_opening_element [(nested_identifier (identifier)) (identifier)] - @font-lock-function-name-face) + @font-lock-function-call-face) (jsx_closing_element [(nested_identifier (identifier)) (identifier)] - @font-lock-function-name-face) + @font-lock-function-call-face) (jsx_self_closing_element [(nested_identifier (identifier)) (identifier)] - @font-lock-function-name-face) + @font-lock-function-call-face) (jsx_attribute (property_identifier) @@ -3684,8 +3681,8 @@ For OVERRIDE, START, END, see `treesit-font-lock-rules'." (treesit-fontify-with-override (treesit-node-start node) (treesit-node-end node) (pcase (treesit-node-type node) - ("identifier" 'font-lock-variable-name-face) - ("property_identifier" 'font-lock-property-face)) + ("identifier" 'font-lock-variable-ref-face) + ("property_identifier" 'font-lock-property-ref-face)) override start end))) (defun js--treesit-defun-name (node) |