(defvar js--treesit-font-lock-settings
(treesit-font-lock-rules
+
:language 'javascript
:override t
:feature 'comment
- `((comment) @font-lock-comment-face)
+ `((comment) @font-lock-comment-face
+ (comment) @contextual)
+
:language 'javascript
:override t
:feature 'constant
[(true) (false) (null)] @font-lock-constant-face
(number) @font-lock-constant-face)
+
:language 'javascript
:override t
:feature 'keyword
`([,@js--treesit-keywords] @font-lock-keyword-face
[(this) (super)] @font-lock-keyword-face)
+
:language 'javascript
:override t
:feature 'string
`((regex pattern: (regex_pattern)) @font-lock-string-face
(string) @font-lock-string-face
+ (string) @contextual
(template_string) @js--fontify-template-string
+ (template_string) @contextual
(template_substitution ["${" "}"] @font-lock-builtin-face))
+
:language 'javascript
:override t
:feature 'declaration
(identifier)
@font-lock-function-name-face)
value: (array (number) (function))))
+
:language 'javascript
:override t
:feature 'identifier
(arrow_function
parameter: (identifier) @font-lock-variable-name-face))
+
:language 'javascript
:override t
:feature 'expression
left: [(identifier) @font-lock-variable-name-face
(member_expression
property: (property_identifier) @font-lock-variable-name-face)]))
+
:language 'javascript
:override t
:feature 'property
((shorthand_property_identifier) @font-lock-variable-name-face)
((shorthand_property_identifier_pattern) @font-lock-variable-name-face))
+
:language 'javascript
:override t
:feature 'pattern
`((pair_pattern key: (property_identifier) @font-lock-variable-name-face)
(array_pattern (identifier) @font-lock-variable-name-face))
+
:language 'javascript
:override t
:feature 'jsx
(defvar ts-mode--font-lock-settings
(treesit-font-lock-rules
+
:language 'tsx
:override t
:feature 'comment
- `((comment) @font-lock-comment-face)
+ `((comment) @font-lock-comment-face
+ (comment) @contextual)
+
:language 'tsx
:override t
:feature 'constant
[(true) (false) (null)] @font-lock-constant-face
(number) @font-lock-constant-face)
+
:language 'tsx
:override t
:feature 'keyword
`([,@ts-mode--keywords] @font-lock-keyword-face
[(this) (super)] @font-lock-keyword-face)
+
:language 'tsx
:override t
:feature 'string
`((regex pattern: (regex_pattern)) @font-lock-string-face
(string) @font-lock-string-face
+ (string) @contextual
(template_string) @js--fontify-template-string
+ (template_string) @contextual
(template_substitution ["${" "}"] @font-lock-builtin-face))
+
:language 'tsx
:override t
:feature 'declaration
(identifier)
(identifier) @font-lock-function-name-face)
value: (array (number) (function))))
+
:language 'tsx
:override t
:feature 'identifier
[(_ (identifier) @font-lock-variable-name-face)
(_ (_ (identifier) @font-lock-variable-name-face))
(_ (_ (_ (identifier) @font-lock-variable-name-face)))]))
+
:language 'tsx
:override t
:feature 'expression
[(identifier) @font-lock-function-name-face
(member_expression
property: (property_identifier) @font-lock-function-name-face)]))
+
:language 'tsx
:override t
:feature 'property
((shorthand_property_identifier_pattern)
@font-lock-variable-name-face))
+
:language 'tsx
:override t
:feature 'pattern
key: (property_identifier) @font-lock-variable-name-face)
(array_pattern (identifier) @font-lock-variable-name-face))
+
:language 'tsx
:override t
:feature 'jsx