From ec5cc623fb9d0f8bf0258eccb229415cad2b7231 Mon Sep 17 00:00:00 2001 From: arkh Date: Mon, 13 Apr 2026 09:31:46 +0300 Subject: [PATCH] =?UTF-8?q?fix(dart):=20address=20review=20feedback=20?= =?UTF-8?q?=E2=80=94=20await=20member-chain,=20cascade=20comment,=20static?= =?UTF-8?q?=5Ffinal=20comment,=20add=20to=20query-compilation=20smoke=20te?= =?UTF-8?q?st?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gitnexus/src/core/ingestion/tree-sitter-queries.ts | 9 +++++++-- gitnexus/test/integration/query-compilation.test.ts | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/gitnexus/src/core/ingestion/tree-sitter-queries.ts b/gitnexus/src/core/ingestion/tree-sitter-queries.ts index a96c23ff6..d11201b39 100644 --- a/gitnexus/src/core/ingestion/tree-sitter-queries.ts +++ b/gitnexus/src/core/ingestion/tree-sitter-queries.ts @@ -1148,10 +1148,12 @@ export const DART_QUERIES = ` (selector (argument_part))) @call ; ── Calls: await method chain (await obj.method()) ─────────────────────────── +; Requires argument_part to distinguish method calls from field access (await obj.field) (await_expression (selector (unconditional_assignable_selector - (identifier) @call.name))) @call + (identifier) @call.name)) + (selector (argument_part))) @call ; ── Calls: named argument (foo(child: buildX())) ───────────────────────────── (named_argument @@ -1166,11 +1168,14 @@ export const DART_QUERIES = ` (selector (argument_part))) @call ; ── Calls: cascade (obj..add(x)..sort()) ───────────────────────────────────── +; Note: cascade_selector contains identifier directly (no unconditional_assignable_selector +; wrapper in Dart grammar), so inferCallForm() classifies these as free calls rather than +; member calls. Cross-file resolution still benefits from the call being recorded. (cascade_section (cascade_selector (identifier) @call.name) (argument_part)) @call -; ── Calls: static/const field initializers (const _svc = MyService()) ──────── +; ── Calls: static final field initializers (static final _svc = MyService()) ── (static_final_declaration (identifier) @call.name . diff --git a/gitnexus/test/integration/query-compilation.test.ts b/gitnexus/test/integration/query-compilation.test.ts index d0fd038a7..6652a59bf 100644 --- a/gitnexus/test/integration/query-compilation.test.ts +++ b/gitnexus/test/integration/query-compilation.test.ts @@ -33,6 +33,7 @@ describe('Query compilation smoke tests', () => { [SupportedLanguages.PHP]: 'test.php', [SupportedLanguages.Kotlin]: 'Test.kt', [SupportedLanguages.Swift]: 'test.swift', + [SupportedLanguages.Dart]: 'test.dart', }; // Known query compilation failures — remove from this set as PRs fix them