mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-06 16:08:05 +00:00
57 lines
1.2 KiB
Scheme
57 lines
1.2 KiB
Scheme
; From nvim-treesitter queries/lua/locals.scm (Apache-2.0)
|
|
|
|
; Scopes
|
|
[
|
|
(chunk)
|
|
(do_statement)
|
|
(while_statement)
|
|
(repeat_statement)
|
|
(if_statement)
|
|
(for_statement)
|
|
(function_declaration)
|
|
(function_definition)
|
|
] @local.scope
|
|
|
|
; Definitions
|
|
(assignment_statement
|
|
(variable_list
|
|
(identifier) @local.definition.var))
|
|
|
|
(assignment_statement
|
|
(variable_list
|
|
(dot_index_expression
|
|
.
|
|
(_) @local.definition.associated
|
|
(identifier) @local.definition.var)))
|
|
|
|
((function_declaration
|
|
name: (identifier) @local.definition.function)
|
|
(#set! definition.function.scope "parent"))
|
|
|
|
((function_declaration
|
|
name: (dot_index_expression
|
|
.
|
|
(_) @local.definition.associated
|
|
(identifier) @local.definition.function))
|
|
(#set! definition.method.scope "parent"))
|
|
|
|
((function_declaration
|
|
name: (method_index_expression
|
|
.
|
|
(_) @local.definition.associated
|
|
(identifier) @local.definition.method))
|
|
(#set! definition.method.scope "parent"))
|
|
|
|
(for_generic_clause
|
|
(variable_list
|
|
(identifier) @local.definition.var))
|
|
|
|
(for_numeric_clause
|
|
name: (identifier) @local.definition.var)
|
|
|
|
(parameters
|
|
(identifier) @local.definition.parameter)
|
|
|
|
; References
|
|
(identifier) @local.reference
|