mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 01:40:02 -04:00
feat(javascript): highlight parameter destructuring patterns
This commit is contained in:
parent
3c42a6400e
commit
aab2274e2c
2 changed files with 25 additions and 0 deletions
|
|
@ -12,6 +12,12 @@
|
||||||
(object_pattern
|
(object_pattern
|
||||||
(shorthand_property_identifier_pattern) @parameter))
|
(shorthand_property_identifier_pattern) @parameter))
|
||||||
|
|
||||||
|
;; ({ a = b }) => null
|
||||||
|
(formal_parameters
|
||||||
|
(object_pattern
|
||||||
|
(object_assignment_pattern
|
||||||
|
(shorthand_property_identifier_pattern) @parameter)))
|
||||||
|
|
||||||
;; ({ a: b }) => null
|
;; ({ a: b }) => null
|
||||||
(formal_parameters
|
(formal_parameters
|
||||||
(object_pattern
|
(object_pattern
|
||||||
|
|
@ -23,6 +29,19 @@
|
||||||
(array_pattern
|
(array_pattern
|
||||||
(identifier) @parameter))
|
(identifier) @parameter))
|
||||||
|
|
||||||
|
;; ({ a } = { a }) => null
|
||||||
|
(formal_parameters
|
||||||
|
(assignment_pattern
|
||||||
|
(object_pattern
|
||||||
|
(shorthand_property_identifier_pattern) @parameter)))
|
||||||
|
|
||||||
|
;; ({ a = b } = { a }) => null
|
||||||
|
(formal_parameters
|
||||||
|
(assignment_pattern
|
||||||
|
(object_pattern
|
||||||
|
(object_assignment_pattern
|
||||||
|
(shorthand_property_identifier_pattern) @parameter))))
|
||||||
|
|
||||||
;; a => null
|
;; a => null
|
||||||
(arrow_function
|
(arrow_function
|
||||||
parameter: (identifier) @parameter)
|
parameter: (identifier) @parameter)
|
||||||
|
|
|
||||||
|
|
@ -115,6 +115,12 @@
|
||||||
(object_pattern
|
(object_pattern
|
||||||
(shorthand_property_identifier_pattern) @parameter))
|
(shorthand_property_identifier_pattern) @parameter))
|
||||||
|
|
||||||
|
;; ({ a = b }) => null
|
||||||
|
(required_parameter
|
||||||
|
(object_pattern
|
||||||
|
(object_assignment_pattern
|
||||||
|
(shorthand_property_identifier_pattern) @parameter)))
|
||||||
|
|
||||||
;; ({ a: b }) => null
|
;; ({ a: b }) => null
|
||||||
(required_parameter
|
(required_parameter
|
||||||
(object_pattern
|
(object_pattern
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue