mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 03:56:52 -04:00
locals(js,ts): Add parameters again (#1231)
This commit is contained in:
parent
4a7a713c52
commit
788d212ab3
3 changed files with 56 additions and 28 deletions
|
|
@ -1 +1,33 @@
|
|||
; inherits: ecma,jsx
|
||||
|
||||
(formal_parameters
|
||||
(identifier) @definition.parameter)
|
||||
|
||||
; function(arg = []) {
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
left: (identifier) @definition.parameter))
|
||||
|
||||
; x => x
|
||||
(arrow_function
|
||||
parameter: (identifier) @definition.parameter)
|
||||
|
||||
;; ({ a }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @definition.parameter))
|
||||
|
||||
;; ({ a: b }) => null
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(pair_pattern
|
||||
value: (identifier) @definition.parameter)))
|
||||
|
||||
;; ([ a ]) => null
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @definition.parameter))
|
||||
|
||||
(formal_parameters
|
||||
(rest_pattern
|
||||
(identifier) @definition.parameter))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue