Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/ecma/locals.scm')
-rw-r--r--runtime/queries/ecma/locals.scm29
1 files changed, 23 insertions, 6 deletions
diff --git a/runtime/queries/ecma/locals.scm b/runtime/queries/ecma/locals.scm
index 594a5f50..df8eb0d3 100644
--- a/runtime/queries/ecma/locals.scm
+++ b/runtime/queries/ecma/locals.scm
@@ -3,22 +3,39 @@
[
(statement_block)
+ (function)
(arrow_function)
- (function_expression)
(function_declaration)
(method_definition)
- (for_statement)
- (for_in_statement)
- (catch_clause)
- (finally_clause)
] @local.scope
; Definitions
;------------
+; ...i
+(rest_pattern
+ (identifier) @local.definition)
+
+; { i }
+(object_pattern
+ (shorthand_property_identifier_pattern) @local.definition)
+
+; { a: i }
+(object_pattern
+ (pair_pattern
+ value: (identifier) @local.definition))
+
+; [ i ]
+(array_pattern
+ (identifier) @local.definition)
+
; i => ...
(arrow_function
- parameter: (identifier) @local.definition.variable.parameter)
+ parameter: (identifier) @local.definition)
+
+; const/let/var i = ...
+(variable_declarator
+ name: (identifier) @local.definition)
; References
;------------