fix(parser): add explicit continue for self_parameter skip (#649)#657
fix(parser): add explicit continue for self_parameter skip (#649)#657carlos-alm merged 1 commit intomainfrom
Conversation
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.
|
Claude finished @carlos-alm's task —— View job Comprehensive PR ReviewPR #657: fix(parser): add explicit continue for self_parameter skip Root Cause AnalysisProblem Being Solved: WASM-native engine parity gap in Rust parameter extraction. The WASM engine had functionally correct but stylistically inconsistent code compared to the native engine. Why This Approach: Both engines must produce identical results per CLAUDE.md requirements. The native engine explicitly uses Risk Assessment: ZERO RISK - This is purely cosmetic. The Configuration Changes (✓ PASS)
Test Integrity (✓ PASS)
Code Quality (✓ PASS)
Backlog Compliance
Critical ConcernsNONE - This is the safest possible change:
Final Recommendation
Note: While stylistic changes usually merit lower priority, engine parity is foundational to codegraph's dual-engine architecture. This change eliminates a minor inconsistency that could confuse future maintainers. |
Greptile SummaryThis PR adds an explicit Key points:
Confidence Score: 5/5Safe to merge — single-line clarity fix with no behavioral change. The change is a one-line addition of an explicit No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Loop over paramListNode children] --> B{param is null?}
B -- Yes --> C[continue]
B -- No --> D{param.type === 'self_parameter'?}
D -- Yes --> E["// Skip self parameter\ncontinue <- NEW explicit continue"]
D -- No --> F{param.type === 'parameter'?}
F -- Yes --> G[Extract pattern child]
G --> H{pattern exists?}
H -- Yes --> I[Push SubDeclaration to params]
H -- No --> J[Skip]
F -- No --> K[Skip other node types]
I --> A
J --> A
K --> A
C --> A
E --> A
Reviews (1): Last reviewed commit: "fix(parser): close WASM–native engine pa..." | Re-trigger Greptile |
Summary
continueinextractRustParameterswhen skippingself_parameternodes, matching native engine behaviorThe original parity fix (commit c898a4a on
fix/wasm-engine-parity-649) contained 5 fixes. Four of the five already reached main through other PRs (#618, #637, #651, etc.). This PR lands the one remaining change: an explicitcontinuestatement in the WASM Rust extractor'sself_parameterguard.While the empty
ifblock was functionally equivalent (theelse ifprevented fall-through), the explicitcontinueis clearer and matches the pattern used elsewhere in the codebase.Closes #649
Test plan
else ifalready preventedself_parameterfrom being extracted)