AST analyzer: tree-sitter parse into FileAst model (v0.1.1)#8
Merged
Conversation
No AI, internal model. devpilot-analysis implements the CodeAnalyzer port on tree-sitter for Rust and TypeScript/JavaScript (incl. TSX/JSX), extracting functions, classes, interfaces, imports and exports into a serializable FileAst. Extraction is pure syntax with per-file error handling. The CodeAnalyzer port is refocused from metrics onto AST parsing; metrics types stay for a later step. Exposed as the parse_file command via DI with a typed lib/ipc/ast layer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
AST analyzer — parses a source file into a structural internal JSON model. No AI.
FileAst(core):functions,classes,interfaces,imports,exportswith line ranges andis_async. Serializable → JSON.devpilot-analysisnow implements theCodeAnalyzerport on tree-sitter for Rust and TypeScript/JavaScript (incl. TSX/JSX grammars). Pure syntactic extraction via a tree walk; a parse failure is a per-fileAnalysisError, never a panic. Blocking parse runs inspawn_blocking.CodeAnalyzermoves from the metrics-orientedanalyze_file -> FileAnalysis(unused scaffolding) toparse -> FileAst. The metrics types stay for a later complexity step.parse_fileTauri command via DI; typedlib/ipc/ast.ts.struct/enum→ classes (methods attached fromimplblocks),trait→ interfaces,use→ imports,pubitems → exports.Verification
cargo fmt --check,clippy -D warnings, fullcargo test --workspace: clean. tree-sitter C grammars compile.pub/exportdetection, unsupported-language error).cargo build -p devpilot-desktopandpnpm build(tsc strict): clean.Scope per plan: internal model + command + tests, no UI (a symbols viewer can follow).
🤖 Generated with Claude Code