nvim-treesitter/queries/squirrel/locals.scm

76 lines
1.2 KiB
Scheme
Raw Normal View History

2023-03-06 04:46:43 -05:00
; Scopes
[
(script)
(class_declaration)
(enum_declaration)
(function_declaration)
(attribute_declaration)
(array)
(block)
(table)
(anonymous_function)
(parenthesized_expression)
(if_statement)
(else_statement)
(while_statement)
(do_while_statement)
(switch_statement)
(for_statement)
(foreach_statement)
(try_statement)
(catch_statement)
] @local.scope
2023-03-06 04:46:43 -05:00
; References
[
(identifier)
(global_variable)
] @local.reference
2023-03-06 04:46:43 -05:00
; Definitions
(const_declaration
2024-01-06 15:05:50 +09:00
.
(identifier) @local.definition.constant)
2023-03-06 04:46:43 -05:00
(enum_declaration
2024-01-06 15:05:50 +09:00
.
(identifier) @local.definition.enum)
2023-03-06 04:46:43 -05:00
(member_declaration
2024-01-06 15:05:50 +09:00
(identifier) @local.definition.field
.
"=")
2023-03-06 04:46:43 -05:00
(table_slot
2024-01-06 15:05:50 +09:00
.
(identifier) @local.definition.field
.
[
"="
":"
])
2023-03-06 04:46:43 -05:00
((function_declaration
2024-01-06 15:05:50 +09:00
.
(identifier) @local.definition.function)
(#not-has-ancestor? @local.definition.function member_declaration))
2023-03-06 04:46:43 -05:00
(member_declaration
(function_declaration
2024-01-06 15:05:50 +09:00
.
(identifier) @local.definition.method))
2023-03-06 04:46:43 -05:00
(class_declaration
2024-01-06 15:05:50 +09:00
.
(identifier) @local.definition.type)
2023-03-06 04:46:43 -05:00
(var_statement
2024-01-06 15:05:50 +09:00
"var"
.
(identifier) @local.definition.var)
2023-03-06 04:46:43 -05:00
(local_declaration
(identifier) @local.definition.var
2024-01-06 15:05:50 +09:00
.
"=")