2024-01-06 15:05:50 +09:00
|
|
|
; Imports
|
2022-01-06 02:20:42 +03:00
|
|
|
(package_header
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
(identifier) @local.definition.namespace)
|
2022-01-06 02:20:42 +03:00
|
|
|
|
|
|
|
|
(import_header
|
2024-01-06 15:05:50 +09:00
|
|
|
(identifier
|
|
|
|
|
(simple_identifier) @local.definition.import .)
|
|
|
|
|
(import_alias
|
|
|
|
|
(type_identifier) @local.definition.import)?)
|
2022-01-06 02:20:42 +03:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Functions
|
2022-01-06 02:20:42 +03:00
|
|
|
(function_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
.
|
|
|
|
|
(simple_identifier) @local.definition.function
|
2024-07-27 16:28:19 -07:00
|
|
|
(#set! definition.function.scope "parent"))
|
2022-01-06 02:20:42 +03:00
|
|
|
|
|
|
|
|
(class_body
|
2024-01-06 15:05:50 +09:00
|
|
|
(function_declaration
|
|
|
|
|
.
|
|
|
|
|
(simple_identifier) @local.definition.method)
|
2024-07-27 16:28:19 -07:00
|
|
|
(#set! definition.method.scope "parent"))
|
2022-01-06 02:20:42 +03:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Variables
|
2022-01-06 02:20:42 +03:00
|
|
|
(function_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
(function_value_parameters
|
|
|
|
|
(parameter
|
|
|
|
|
(simple_identifier) @local.definition.parameter)))
|
2022-01-06 02:20:42 +03:00
|
|
|
|
|
|
|
|
(lambda_literal
|
2024-01-06 15:05:50 +09:00
|
|
|
(lambda_parameters
|
|
|
|
|
(variable_declaration
|
|
|
|
|
(simple_identifier) @local.definition.parameter)))
|
2022-01-06 02:20:42 +03:00
|
|
|
|
2024-02-06 20:51:50 +08:00
|
|
|
; NOTE: temporary fix for treesitter bug that causes delay in file opening
|
|
|
|
|
;(class_body
|
|
|
|
|
; (property_declaration
|
|
|
|
|
; (variable_declaration
|
|
|
|
|
; (simple_identifier) @local.definition.field)))
|
2022-01-06 02:20:42 +03:00
|
|
|
(class_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
(primary_constructor
|
|
|
|
|
(class_parameter
|
|
|
|
|
(simple_identifier) @local.definition.field)))
|
2022-01-06 02:20:42 +03:00
|
|
|
|
|
|
|
|
(enum_class_body
|
2024-01-06 15:05:50 +09:00
|
|
|
(enum_entry
|
|
|
|
|
(simple_identifier) @local.definition.field))
|
2022-01-06 02:20:42 +03:00
|
|
|
|
|
|
|
|
(variable_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
(simple_identifier) @local.definition.var)
|
2022-01-06 02:20:42 +03:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Types
|
2022-01-06 02:20:42 +03:00
|
|
|
(class_declaration
|
2024-01-06 15:05:50 +09:00
|
|
|
(type_identifier) @local.definition.type
|
2024-07-27 16:28:19 -07:00
|
|
|
(#set! definition.type.scope "parent"))
|
2022-01-06 02:20:42 +03:00
|
|
|
|
|
|
|
|
(type_alias
|
2024-01-06 15:05:50 +09:00
|
|
|
(type_identifier) @local.definition.type
|
2024-07-27 16:28:19 -07:00
|
|
|
(#set! definition.type.scope "parent"))
|
2022-01-06 02:20:42 +03:00
|
|
|
|
2024-01-06 15:05:50 +09:00
|
|
|
; Scopes
|
2022-01-06 02:20:42 +03:00
|
|
|
[
|
2024-01-06 15:05:50 +09:00
|
|
|
(if_expression)
|
|
|
|
|
(when_expression)
|
|
|
|
|
(when_entry)
|
|
|
|
|
(for_statement)
|
|
|
|
|
(while_statement)
|
|
|
|
|
(do_while_statement)
|
|
|
|
|
(lambda_literal)
|
|
|
|
|
(function_declaration)
|
|
|
|
|
(primary_constructor)
|
|
|
|
|
(secondary_constructor)
|
|
|
|
|
(anonymous_initializer)
|
|
|
|
|
(class_declaration)
|
|
|
|
|
(enum_class_body)
|
|
|
|
|
(enum_entry)
|
|
|
|
|
(interpolated_expression)
|
2023-07-22 15:29:32 +02:00
|
|
|
] @local.scope
|