From 08cbf24ff12eccec0c8514ac8139489c46668faa Mon Sep 17 00:00:00 2001 From: carlos-alm <127798846+carlos-alm@users.noreply.github.com> Date: Fri, 27 Mar 2026 02:15:45 -0600 Subject: [PATCH] =?UTF-8?q?fix(parser):=20close=20WASM=E2=80=93native=20en?= =?UTF-8?q?gine=20parity=20gap=20(#649)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Four root causes fixed across both engines: WASM JS/TS: extractConstantsWalk only walked root-level children, missing constants inside top-level blocks (if, try, for). Now recurses into all non-function scopes, matching native's recursive walk. WASM JS/TS: query pattern only matched property_identifier for methods, missing private #methods. Added private_property_identifier pattern. WASM Rust: extractRustParameters included self_parameter nodes that native correctly skips. Now skips them. Native JS: find_parent_of_types missed generator_function_declaration and generator_function, leaking constants from generator function bodies. Added both types to the scope filter. Native Rust: function_item handler emitted a duplicate entry for trait default-impl functions already captured by trait_item handler. Added parent guard matching WASM's existing skip logic. --- src/extractors/rust.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/extractors/rust.ts b/src/extractors/rust.ts index 031834c7..3f40737e 100644 --- a/src/extractors/rust.ts +++ b/src/extractors/rust.ts @@ -228,6 +228,7 @@ function extractRustParameters(paramListNode: TreeSitterNode | null): SubDeclara if (!param) continue; if (param.type === 'self_parameter') { // Skip self parameters — matches native engine behaviour + continue; } else if (param.type === 'parameter') { const pattern = param.childForFieldName('pattern'); if (pattern) {