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
refactor(core): parse once per file, not 3x — extractors take pre-computed AST
Address review findings:
1. runQueries doing too much: extracted runAllAstQueries() that parses
once and runs all 12 queries. Extractors now take a pre-computed
Map<string, number> instead of matcher+filePath (pure functions).
2. 3x parsing eliminated: analyzeFileFromIndex and analyzeFileWithDocs
call runAllAstQueries once, pass results to all 3 extractors.
3. Extractors are now synchronous pure functions — easier to test,
no async overhead, no hidden parsing.
Tests updated to match new signatures. Same 51 test count, same coverage.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/scratchpad.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,10 @@
17
17
- Vue/Svelte SFC support — `.vue`/`.svelte` files have embedded `<script lang="ts">` blocks. Would need script block extraction before tree-sitter parsing. Lower priority — co-located `.ts` files in those projects already get full analysis.
18
18
- Swap `WasmPatternMatcher` to `@ast-grep/napi` if bulk scanning perf becomes an issue (~4x faster native Rust). Interface is ready; implementation is mechanical.
19
19
20
+
## Test Gaps
21
+
22
+
-**InspectAdapter integration test with PatternMatcher.** The InspectAdapter test constructs without a `patternMatcher` — the AST path is never exercised through the MCP layer. Needs a test that constructs `InspectAdapter` with `createPatternMatcher()`, mocks the search service, calls `execute()`, and verifies AST-enhanced results flow through. Requires mock search service setup — larger integration test scope.
23
+
20
24
## Notes
21
25
22
26
- Both pattern analysis paths (index vs scan) must use the same pure extractors from 1.1 to avoid drift. Test this explicitly.
0 commit comments