2021-03-09 23:14:27 +01:00
|
|
|
; Scopes
|
|
|
|
|
;-------
|
2023-07-22 15:29:32 +02:00
|
|
|
(statement_block) @local.scope
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2024-01-31 10:55:10 -05:00
|
|
|
(function_expression) @local.scope
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(arrow_function) @local.scope
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(function_declaration) @local.scope
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(method_definition) @local.scope
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(for_statement) @local.scope
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(for_in_statement) @local.scope
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(catch_clause) @local.scope
|
2021-03-09 23:14:27 +01:00
|
|
|
|
|
|
|
|
; Definitions
|
|
|
|
|
;------------
|
|
|
|
|
(variable_declarator
|
2023-07-22 15:29:32 +02:00
|
|
|
name: (identifier) @local.definition.var)
|
2021-03-09 23:14:27 +01:00
|
|
|
|
2025-11-05 01:03:42 -03:00
|
|
|
(variable_declarator
|
|
|
|
|
name: (object_pattern
|
|
|
|
|
(shorthand_property_identifier_pattern) @local.definition.var))
|
|
|
|
|
|
2026-02-27 00:24:52 -03:00
|
|
|
(variable_declarator
|
|
|
|
|
(object_pattern
|
|
|
|
|
(pair_pattern
|
|
|
|
|
(identifier) @local.definition.var)))
|
|
|
|
|
|
2021-03-09 23:14:27 +01:00
|
|
|
(import_specifier
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.import)
|
2021-03-09 23:14:27 +01:00
|
|
|
|
|
|
|
|
(namespace_import
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.definition.import)
|
2021-03-09 23:14:27 +01:00
|
|
|
|
|
|
|
|
(function_declaration
|
2024-01-21 22:05:44 +09:00
|
|
|
(identifier) @local.definition.function
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! definition.var.scope parent))
|
2021-03-09 23:14:27 +01:00
|
|
|
|
2022-05-10 13:59:11 +01:00
|
|
|
(method_definition
|
2024-01-21 22:05:44 +09:00
|
|
|
(property_identifier) @local.definition.function
|
2024-01-06 15:05:50 +09:00
|
|
|
(#set! definition.var.scope parent))
|
2022-05-10 13:59:11 +01:00
|
|
|
|
2021-03-09 23:14:27 +01:00
|
|
|
; References
|
|
|
|
|
;------------
|
2023-07-22 15:29:32 +02:00
|
|
|
(identifier) @local.reference
|
2024-01-06 15:05:50 +09:00
|
|
|
|
2023-07-22 15:29:32 +02:00
|
|
|
(shorthand_property_identifier) @local.reference
|