2022-08-03 09:09:44 +04:00
|
|
|
; Scopes
|
|
|
|
;-------
|
|
|
|
|
|
|
|
[
|
|
|
|
(statement_block)
|
|
|
|
(function)
|
|
|
|
(arrow_function)
|
|
|
|
(function_declaration)
|
|
|
|
(method_definition)
|
|
|
|
] @local.scope
|
|
|
|
|
|
|
|
; Definitions
|
|
|
|
;------------
|
|
|
|
|
2023-07-09 20:35:32 +04:00
|
|
|
; ...i
|
|
|
|
(rest_pattern
|
|
|
|
(identifier) @local.definition)
|
|
|
|
|
|
|
|
; { i }
|
|
|
|
(object_pattern
|
|
|
|
(shorthand_property_identifier_pattern) @local.definition)
|
2022-08-03 09:09:44 +04:00
|
|
|
|
2023-07-09 20:35:32 +04:00
|
|
|
; { a: i }
|
|
|
|
(object_pattern
|
|
|
|
(pair_pattern
|
|
|
|
value: (identifier) @local.definition))
|
|
|
|
|
|
|
|
; [ i ]
|
|
|
|
(array_pattern
|
2022-08-03 09:09:44 +04:00
|
|
|
(identifier) @local.definition)
|
2023-07-09 20:35:32 +04:00
|
|
|
|
|
|
|
; i => ...
|
2022-08-03 09:09:44 +04:00
|
|
|
(arrow_function
|
|
|
|
parameter: (identifier) @local.definition)
|
|
|
|
|
2023-07-09 20:35:32 +04:00
|
|
|
; const/let/var i = ...
|
2022-08-03 09:09:44 +04:00
|
|
|
(variable_declarator
|
|
|
|
name: (identifier) @local.definition)
|
|
|
|
|
|
|
|
; References
|
|
|
|
;------------
|
|
|
|
|
|
|
|
(identifier) @local.reference
|