From df1ea8cba3caebe9690cb6fd80d075988e53f91e Mon Sep 17 00:00:00 2001 From: Nik Revenco Date: Sat, 12 Jul 2025 15:38:50 +0100 Subject: [PATCH] queries: do not highlight `bar` in `bar = || ()` as closure --- runtime/queries/rust/highlights.scm | 7 ------- runtime/queries/rust/locals.scm | 15 --------------- 2 files changed, 22 deletions(-) diff --git a/runtime/queries/rust/highlights.scm b/runtime/queries/rust/highlights.scm index babc1ce7d..5e3471b36 100644 --- a/runtime/queries/rust/highlights.scm +++ b/runtime/queries/rust/highlights.scm @@ -305,13 +305,6 @@ ; Functions ; ------- -; In here, `bar` is a function, as it is equal to a closure: -; -; let bar = || 4; -(let_declaration - pattern: (identifier) @function - value: (closure_expression)) - ; highlight `baz` in `any_function(foo::bar::baz)` as function ; This generically works for an unlimited number of path segments: ; diff --git a/runtime/queries/rust/locals.scm b/runtime/queries/rust/locals.scm index 0267a55dd..3262f9473 100644 --- a/runtime/queries/rust/locals.scm +++ b/runtime/queries/rust/locals.scm @@ -41,18 +41,3 @@ ; References (identifier) @local.reference - -; In here, `bar` is a function, as it is equal to a closure: -; -; let bar = || 4; -; -; After this, we know that `bar` must be a function: -; -; let a = bar; -; ^^^ function -; -; let a = f(bar) -; ^^^ function -(let_declaration - pattern: (identifier) @local.definition.function - value: (closure_expression))