You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(parity): restore call AST node extraction in WASM engine (#705)
* refactor(extractors): add parser abstraction layer (Phase 7.1)
Extract shared patterns from 9 language extractors into 4 reusable
helpers in helpers.ts, reducing per-language boilerplate by ~30 lines:
- findParentNode: replaces 6 findParent*/findCurrentImpl functions
- extractBodyMembers: replaces 5 body-iteration patterns for enums/structs
- stripQuotes: replaces inline .replace(/"/g,'') across 3 extractors
- lastPathSegment: replaces inline .split('.').pop() across 6 extractors
Net: +77 helper lines, -159 extractor lines = -82 lines total.
* fix: address Greptile review comments (#700)
Add clarifying comment to empty self_parameter if-block in rust.ts
and document anchored-vs-global semantics in stripQuotes JSDoc.
* fix: revert subpath imports to relative imports in builder stages
* fix(parity): restore call AST node extraction in WASM engine (#697)
PR #686 incorrectly removed call_expression extraction from the WASM
ast-store-visitor and added filters to strip call nodes from native
output — documenting a parity gap as expected behavior rather than
fixing it. This restores full parity:
- Restore call_expression in JS astTypes map
- Restore call extraction logic in ast-store-visitor with receiver
extraction, argument-only recursion, and dedup tracking
- Remove three call-kind filters (engine.ts, ast.ts bulk path, ast.ts
JS fallback path) that stripped native call nodes
- Clear stale engineOpts.nativeDb reference after pipeline closes the
NativeDatabase to prevent stages from using a closed connection
- Update ast-nodes test to assert calls ARE stored
* fix: make enterNode skipChildren guard unconditional for matched nodes (#705)
When enterNode encountered an already-matched node it returned undefined,
relying on the parent call's skipChildren to prevent redundant descent.
This was correct but fragile — a future change to walkCallArguments could
silently break the invariant. Now returns { skipChildren: true } explicitly.
* fix: pin exact call node count in ast-nodes test (#705)
Replace loose toBeGreaterThanOrEqual(1) with exact toBe(3) and verify
each expected call name (eval, result.set, console.log). The fixture
produces exactly 3 call nodes — fetch is captured as kind:await instead.
Pinning the count catches future parity regressions immediately.
* fix: revert enterNode skipChildren guard — node.id reuse causes false skips (#705)
Reverts the { skipChildren: true } guard for matched nodes. Tree-sitter
node.id is a memory address that can be reused across different nodes in
the same tree. Returning skipChildren on an ID collision suppresses an
unrelated subtree, breaking WASM ast_node extraction in the build-parity
test. The original undefined return is correct: it prevents re-collection
without suppressing children, and the parent call's skipChildren handles
the intended dedup case.
* ci: retry CI run (#705)
* fix: add diagnostic logging for ast_nodes parity failure (#705)
When native and WASM ast_node counts diverge, log both counts and the
distinct kinds present in each. This will reveal whether the CI-only
failure is caused by native extracting calls that WASM misses, or a
deeper issue with the WASM walker path.
* ci: add diagnostic logging to trace WASM ast_nodes CI failure (#705)
* ci: expand diagnostic logging to trace buildAstNodes path (#705)
* fix: coerce null receiver to empty string for NAPI compat (#705)
The prebuilt native binary (v3.5.0) expects `receiver` as `String`
(not `Option<String>`), so passing JS `null` from WASM-extracted
ast_nodes crashes the bulk insert with:
Failed to convert JavaScript value `Null` into rust type `String`
Coerce `null`/`undefined` receiver to `""` before passing to the
native `bulkInsertAstNodes` path. This fixes the build-parity test
(native 19 vs WASM 0 ast_nodes) and the typed-method-call test.
* fix: remove parity-diag console.error logging (#705)
Remove temporary diagnostic logging added to trace the WASM ast_nodes
CI failure. The root cause (null receiver in NAPI bulk insert) is now
fixed, so these stderr diagnostics are no longer needed.
0 commit comments