support Dart#24
Open
MinhDuy-creator wants to merge 1 commit intoFreePeak:mainfrom
Open
Conversation
linhdmn
reviewed
Apr 28, 2026
Member
linhdmn
left a comment
There was a problem hiding this comment.
MR Overview
- Title: support Dart
- Author: MinhDuy-creator
- Branch: feature/support-dart → main
1. Logic Review
Issues Found
-
File:
src/indexer/extractor.rs:89- Severity: warning
- Issue:
tree-sitter-dartcrate version is "0.1.0" which may not be stable. Verify the crate is actively maintained. - Suggestion: Consider pinning to a specific version or verifying compatibility with tree-sitter parser interface.
-
File:
src/indexer/extractor.rs:41- Severity: info
- Issue: Dart test file pattern
_widget_test.dart- only underscores in filename are considered. Flutter also usestest/widget_test.dartconvention. - Suggestion: Already handled by
path.components().any(|c| c.as_os_str() == "test")check.
-
File:
src/indexer/extractor.rs:99- Severity: info
- Issue:
is_noise_callfor Dart includes many keywords (static,final,const,var,extends,implements). These are language keywords, not function calls. However, including them prevents false positives in call relationships. - Suggestion: This is acceptable behavior - keywords used as identifiers in some contexts.
2. Scope Validation
✅ In Scope: Dart language support for indexer
✅ Files: src/indexer/mod.rs, src/indexer/extractor.rs, Cargo.toml, Cargo.lock
3. Impact Analysis
- Changed Functions:
is_test_file,get_tested_file_path,is_noise_call,extract_*methods - Affected Modules: indexer (Dart parsing)
- Risk Level: low (additive language support, no breaking changes)
- New Dependency: tree-sitter-dart
4. Deep Scan Findings
✅ Test coverage: 11 new tests for Dart extraction
✅ Node types supported: class, mixin, extension, type_alias, function_signature, constructor_signature
5. Suggested Description Update
## Scope of Changes
### Files Changed
- `Cargo.toml` - Added tree-sitter-dart dependency
- `src/indexer/mod.rs` - Added .dart to extension list, parser slot 6
- `src/indexer/extractor.rs` - Dart test detection, noise call filtering, node type support
### Impact Analysis
- **Affected Modules:** indexer
- **Risk Level:** low
- **New Tests:** 11 (class, mixin, extension, function, method, import, stateful widget)
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.
Add Dart/Flutter support to LeanKG indexer via tree-sitter-dart.
Cargo.toml - add tree-sitter-dart dependency
src/indexer/mod.rs - add .dart to extension list, new parser slot, filter node_modules
src/indexer/extractor.rs - add Dart test file detection, filter Flutter built-ins (setState, build, context...), support additional node types (mixin, extension, type_alias...), 11 unit tests