[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-29 1014bcc8e32 3/7: Fix fontification of method-invocations in js-
From: |
Yuan Fu |
Subject: |
emacs-29 1014bcc8e32 3/7: Fix fontification of method-invocations in js-ts-mode (bug#59904) |
Date: |
Fri, 9 Dec 2022 19:46:44 -0500 (EST) |
branch: emacs-29
commit 1014bcc8e32c8ab7b25e148d13e7e3a82f9635b9
Author: Jostein Kjønigsen <jostein@kjonigsen.net>
Commit: Yuan Fu <casouri@gmail.com>
Fix fontification of method-invocations in js-ts-mode (bug#59904)
* lisp/progmodes/js.el (js--treesit-font-lock-settings): Move rules
for property in front of function names, so function names override
property.
---
lisp/progmodes/js.el | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/lisp/progmodes/js.el b/lisp/progmodes/js.el
index 45dfef372cd..f7318c481a2 100644
--- a/lisp/progmodes/js.el
+++ b/lisp/progmodes/js.el
@@ -3543,6 +3543,20 @@ This function is intended for use in
`after-change-functions'."
(arrow_function
parameter: (identifier) @font-lock-variable-name-face))
+ :language 'javascript
+ :override t
+ :feature 'property
+ ;; This needs to be before function-name feature, because methods
+ ;; can be both property and function-name, and we want them in
+ ;; function-name face.
+ `((property_identifier) @font-lock-property-face
+
+ (pair value: (identifier) @font-lock-variable-name-face)
+
+ ((shorthand_property_identifier) @font-lock-property-face)
+
+ ((shorthand_property_identifier_pattern) @font-lock-property-face))
+
:language 'javascript
:override t
:feature 'expression
@@ -3611,18 +3625,7 @@ This function is intended for use in
`after-change-functions'."
:language 'javascript
:feature 'escape-sequence
:override t
- '((escape_sequence) @font-lock-escape-face)
-
- :language 'javascript
- :override t
- :feature 'property
- `((property_identifier) @font-lock-property-face
-
- (pair value: (identifier) @font-lock-variable-name-face)
-
- ((shorthand_property_identifier) @font-lock-property-face)
-
- ((shorthand_property_identifier_pattern) @font-lock-property-face)))
+ '((escape_sequence) @font-lock-escape-face))
"Tree-sitter font-lock settings.")
(defun js--fontify-template-string (node override start end &rest _)
- emacs-29 updated (33a8415eb7e -> 8f53fa10d94), Yuan Fu, 2022/12/09
- emacs-29 4df35e3491c 1/7: Improve fontification in csharp-ts-mode (bug#59909), Yuan Fu, 2022/12/09
- emacs-29 839341d7370 5/7: Make more granular defun-type-regexp (bug#59873), Yuan Fu, 2022/12/09
- emacs-29 1014bcc8e32 3/7: Fix fontification of method-invocations in js-ts-mode (bug#59904),
Yuan Fu <=
- emacs-29 7141920c6af 2/7: Fix escape-sequence feature in typescript-ts-mode (bug#59906), Yuan Fu, 2022/12/09
- emacs-29 8de8f1dc051 6/7: Add class_body indentation for typescript (bug#59680), Yuan Fu, 2022/12/09
- emacs-29 8f53fa10d94 7/7: Fontify "this" as a keyword in c++-ts-mode (bug#59924), Yuan Fu, 2022/12/09
- emacs-29 8f49137c9bf 4/7: Add dockerfile-ts-mode (Bug#59894), Yuan Fu, 2022/12/09