mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
Commit 9d7ed4 of the Inko tree-sitter grammar introduces support for pattern matching in `let` expressions. This requires some corresponding changes to the "local" queries to correctly define local variables. This is done by simply defining locals for all "identifier_pattern" nodes, instead of only doing this for "define_variable" nodes.
61 lines
1.1 KiB
Scheme
61 lines
1.1 KiB
Scheme
[
|
|
(method)
|
|
(block)
|
|
] @local.scope
|
|
|
|
((method
|
|
name: _ @local.definition.method) @local.scope
|
|
(#set! definition.function.scope "parent"))
|
|
|
|
(external_function
|
|
name: _ @local.definition.function)
|
|
|
|
(argument
|
|
name: _ @local.definition.parameter)
|
|
|
|
(identifier_pattern
|
|
name: _ @local.definition.var)
|
|
|
|
(define_constant
|
|
name: _ @local.definition.constant)
|
|
|
|
(define_field
|
|
name: _ @local.definition.field)
|
|
|
|
(named_argument
|
|
name: _ @local.definition.parameter)
|
|
|
|
((class
|
|
modifier: (modifier
|
|
"enum")
|
|
name: _ @local.definition.enum) @local.scope
|
|
(#set! definition.type.scope "parent"))
|
|
|
|
(class
|
|
modifier: (modifier
|
|
"enum")
|
|
body: (class_body
|
|
(define_case
|
|
name: _ @local.definition.field)))
|
|
|
|
((class
|
|
name: _ @local.definition.type) @local.scope
|
|
(#set! definition.type.scope "parent"))
|
|
|
|
((trait
|
|
name: _ @local.definition.type) @local.scope
|
|
(#set! definition.type.scope "parent"))
|
|
|
|
(import
|
|
(symbols
|
|
[
|
|
(identifier)
|
|
(constant)
|
|
(self)
|
|
] @local.definition.import))
|
|
|
|
(identifier) @local.reference
|
|
|
|
(field) @local.reference
|
|
|
|
(constant) @local.reference
|