feat(inko): add scoping to the locals queries

This way tooling that makes use of these queries (e.g. snacks.nvim) is
aware of the scoping of Inko types and methods.
This commit is contained in:
Yorick Peterse 2025-05-21 21:47:18 +02:00
parent b19b5ce171
commit f13a5eb0fc

View file

@ -3,8 +3,9 @@
(block) (block)
] @local.scope ] @local.scope
(method ((method
name: _ @local.definition.method) name: _ @local.definition.method) @local.scope
(#set! definition.function.scope "parent"))
(external_function (external_function
name: _ @local.definition.function) name: _ @local.definition.function)
@ -24,10 +25,11 @@
(named_argument (named_argument
name: _ @local.definition.parameter) name: _ @local.definition.parameter)
(class ((class
modifier: (modifier modifier: (modifier
"enum") "enum")
name: _ @local.definition.enum) name: _ @local.definition.enum) @local.scope
(#set! definition.type.scope "parent"))
(class (class
modifier: (modifier modifier: (modifier
@ -36,11 +38,13 @@
(define_case (define_case
name: _ @local.definition.field))) name: _ @local.definition.field)))
(class ((class
name: _ @local.definition.type) name: _ @local.definition.type) @local.scope
(#set! definition.type.scope "parent"))
(trait ((trait
name: _ @local.definition.type) name: _ @local.definition.type) @local.scope
(#set! definition.type.scope "parent"))
(import (import
(symbols (symbols