javascript queries: fix parameters (#3280)
This commit is contained in:
parent
07019c3905
commit
59bf1669ec
3 changed files with 44 additions and 13 deletions
|
@ -1,12 +0,0 @@
|
|||
(formal_parameters
|
||||
[
|
||||
(identifier) @variable.parameter
|
||||
(array_pattern
|
||||
(identifier) @variable.parameter)
|
||||
(object_pattern
|
||||
[
|
||||
(pair_pattern value: (identifier) @variable.parameter)
|
||||
(shorthand_property_identifier_pattern) @variable.parameter
|
||||
])
|
||||
]
|
||||
)
|
|
@ -46,6 +46,43 @@
|
|||
(assignment_expression
|
||||
left: (identifier) @function
|
||||
right: [(function) (arrow_function)])
|
||||
|
||||
; Function and method parameters
|
||||
;-------------------------------
|
||||
|
||||
; (p) => ...
|
||||
(formal_parameters
|
||||
(identifier) @variable.parameter)
|
||||
|
||||
; (...p) => ...
|
||||
(formal_parameters
|
||||
(rest_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
; ({ p }) => ...
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(shorthand_property_identifier_pattern) @variable.parameter))
|
||||
|
||||
; ({ a: p }) => ...
|
||||
(formal_parameters
|
||||
(object_pattern
|
||||
(pair_pattern
|
||||
value: (identifier) @variable.parameter)))
|
||||
|
||||
; ([ p ]) => ...
|
||||
(formal_parameters
|
||||
(array_pattern
|
||||
(identifier) @variable.parameter))
|
||||
|
||||
; (p = 1) => ...
|
||||
(formal_parameters
|
||||
(assignment_pattern
|
||||
left: (identifier) @variable.parameter))
|
||||
|
||||
; p => ...
|
||||
(arrow_function
|
||||
parameter: (identifier) @variable.parameter)
|
||||
|
||||
; Function and method calls
|
||||
;--------------------------
|
||||
|
|
|
@ -12,7 +12,13 @@
|
|||
; Definitions
|
||||
;------------
|
||||
|
||||
(pattern/identifier)@local.definition
|
||||
(pattern/identifier) @local.definition
|
||||
|
||||
(pattern/rest_pattern
|
||||
(identifier) @local.definition)
|
||||
|
||||
(arrow_function
|
||||
parameter: (identifier) @local.definition)
|
||||
|
||||
(variable_declarator
|
||||
name: (identifier) @local.definition)
|
||||
|
|
Loading…
Add table
Reference in a new issue