From d08cf75e1bb52ce86a895dc287f9480a6d3d78b2 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 21 May 2025 21:47:18 +0200 Subject: 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. --- runtime/queries/inko/locals.scm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'runtime') diff --git a/runtime/queries/inko/locals.scm b/runtime/queries/inko/locals.scm index 09450f525..b69681cd1 100644 --- a/runtime/queries/inko/locals.scm +++ b/runtime/queries/inko/locals.scm @@ -3,8 +3,9 @@ (block) ] @local.scope -(method - name: _ @local.definition.method) +((method + name: _ @local.definition.method) @local.scope + (#set! definition.function.scope "parent")) (external_function name: _ @local.definition.function) @@ -24,10 +25,11 @@ (named_argument name: _ @local.definition.parameter) -(class +((class modifier: (modifier "enum") - name: _ @local.definition.enum) + name: _ @local.definition.enum) @local.scope + (#set! definition.type.scope "parent")) (class modifier: (modifier @@ -36,11 +38,13 @@ (define_case name: _ @local.definition.field))) -(class - name: _ @local.definition.type) +((class + name: _ @local.definition.type) @local.scope + (#set! definition.type.scope "parent")) -(trait - name: _ @local.definition.type) +((trait + name: _ @local.definition.type) @local.scope + (#set! definition.type.scope "parent")) (import (symbols -- cgit v1.2.3-70-g09d2