2022-04-14 12:01:23 +08:00
|
|
|
; Scopes
|
|
|
|
;-------
|
|
|
|
|
|
|
|
(statement_block) @scope
|
|
|
|
(function) @scope
|
|
|
|
(arrow_function) @scope
|
|
|
|
(function_declaration) @scope
|
|
|
|
(method_definition) @scope
|
|
|
|
(for_statement) @scope
|
|
|
|
(for_in_statement) @scope
|
|
|
|
(catch_clause) @scope
|
|
|
|
|
|
|
|
; Definitions
|
|
|
|
;------------
|
|
|
|
|
|
|
|
(variable_declarator
|
|
|
|
name: (identifier) @definition.var)
|
|
|
|
|
|
|
|
(import_specifier
|
|
|
|
(identifier) @definition.import)
|
|
|
|
|
|
|
|
(namespace_import
|
|
|
|
(identifier) @definition.import)
|
|
|
|
|
|
|
|
(function_declaration
|
2022-11-14 00:10:02 +08:00
|
|
|
((identifier) @definition.var)
|
2022-04-14 12:01:23 +08:00
|
|
|
(#set! definition.var.scope parent))
|
|
|
|
|
|
|
|
; References
|
|
|
|
;------------
|
|
|
|
|
|
|
|
(identifier) @reference
|
|
|
|
(shorthand_property_identifier) @reference
|