2023-03-11 03:02:30 -05:00
|
|
|
; Scopes
|
|
|
|
|
[
|
|
|
|
|
(module)
|
|
|
|
|
(function_declaration)
|
|
|
|
|
(if_statement)
|
|
|
|
|
(for_statement)
|
|
|
|
|
(match_expression)
|
|
|
|
|
(switch_expression)
|
2023-07-22 15:29:32 +02:00
|
|
|
] @local.scope
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
; References
|
|
|
|
|
[
|
|
|
|
|
(identifier)
|
|
|
|
|
(scoped_type_identifier)
|
2023-07-22 15:29:32 +02:00
|
|
|
] @local.reference
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
; Definitions
|
|
|
|
|
(global_binding
|
2024-01-06 15:05:50 +09:00
|
|
|
(identifier) @local.definition.constant
|
|
|
|
|
.
|
|
|
|
|
":"
|
|
|
|
|
(_))
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
(const_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
"const"
|
|
|
|
|
(identifier) @local.definition.constant
|
|
|
|
|
.
|
|
|
|
|
"=")
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
(field
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
(identifier) @local.definition.field)
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
(field_assignment
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
(identifier) @local.definition.field)
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
(function_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
"fn"
|
|
|
|
|
.
|
|
|
|
|
(identifier) @local.definition.function)
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
(parameter
|
2024-01-06 15:05:50 +09:00
|
|
|
(_) @local.definition.parameter
|
|
|
|
|
.
|
|
|
|
|
":")
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
(type_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
"type"
|
|
|
|
|
(identifier) @local.definition.type
|
|
|
|
|
.
|
|
|
|
|
"=")
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
(type_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
"type"
|
|
|
|
|
(identifier) @local.definition.enum
|
|
|
|
|
.
|
|
|
|
|
"="
|
|
|
|
|
(enum_type))
|
2023-03-11 03:02:30 -05:00
|
|
|
|
|
|
|
|
(let_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
"let"
|
|
|
|
|
.
|
2024-03-03 11:00:11 +01:00
|
|
|
(identifier) @local.definition.var
|
2024-01-06 15:05:50 +09:00
|
|
|
","?)
|