Add Dart support to codebase indexing#941
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughDart is added to tree-sitter’s recognized extensions, parser loading, query exports, and definition extraction coverage. Tests and a Dart fixture verify parser initialization and declarations including classes, methods, mixins, enums, extensions, typedefs, and top-level functions. ChangesDart tree-sitter support
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant SourceFile
participant loadRequiredLanguageParsers
participant DartWasm
participant Query
participant DefinitionParser
SourceFile->>loadRequiredLanguageParsers: provide .dart extension
loadRequiredLanguageParsers->>DartWasm: load Dart grammar
loadRequiredLanguageParsers->>Query: construct query from dartQuery
Query-->>loadRequiredLanguageParsers: return Dart query
DefinitionParser->>Query: extract Dart definitions
Query-->>DefinitionParser: return captured declarations
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Closes: #940
Description
Adds Dart support to Tree-sitter-based codebase indexing.
.dartas a supported source extension and loadstree-sitter-dart.wasm..gitignoreor.rooignorewhen desired.Reviewers should pay particular attention to the query patterns for constructors and top-level accessors, which differ structurally from class method signatures in the Dart grammar.
Test Procedure
Automated tests:
cd src npx vitest run services/tree-sitter/__tests__/languageParser.spec.ts services/tree-sitter/__tests__/parseSourceCodeDefinitions.dart.spec.tsExpected result: 2 test files and 8 tests pass.
The repository pre-commit and pre-push hooks were also run successfully:
Manual verification:
.dartfiles.Pre-Submission Checklist
Screenshots / Videos
Not applicable — this change has no UI impact.
Documentation Updates
Additional Notes
No generated-file suffixes such as
*.g.dartor*.freezed.dartare hard-coded into the exclusion logic. Existing.gitignoreand.rooignorebehavior remains the source of truth, preserving access to generated APIs when projects intentionally index them.Get in Touch
GitHub: @WebMad
Summary by CodeRabbit
New Features
Tests