Skip to content

feat(chunker): add Dart language support#69

Merged
aeneasr merged 4 commits intomainfrom
add-dart
Mar 28, 2026
Merged

feat(chunker): add Dart language support#69
aeneasr merged 4 commits intomainfrom
add-dart

Conversation

@aeneasr
Copy link
Copy Markdown
Member

@aeneasr aeneasr commented Mar 27, 2026

Summary

  • Add full Dart language support via go-sitter-forest/dart tree-sitter grammar
  • 11 query patterns: classes, mixins, enums, extensions, functions, methods (incl. getters/setters), typedefs, constructors
  • findEnclosingSymbol support for qualified Dart method names (scoped to Dart-specific class_body/extension_body to avoid Python/Java/TS regression)
  • Unit + adversarial tests (25+ assertions covering async, generators, sealed/abstract classes, factory constructors, enhanced enums, comment exclusions)
  • 18 E2E fixture files from dart-lang/shelf (BSD-3-Clause) with snapshot test
  • bench-swe task: shelf_router HEAD content-length RFC violation (shelf_router should NOT modify the content-length per RFC dart-lang/shelf#510)
  • Benchmark results: 76% cheaper, 79% faster, 82% fewer tokens with Lumen vs baseline

Closes #60

Benchmark Results

Metric Baseline With Lumen Delta
Cost $0.634 $0.153 -76%
Time 246.1s 50.9s -79%
Output tokens 21,286 3,862 -82%
Tool calls 61 14 -77%
Rating Good Good Same

Test plan

  • go test ./... — all 10 packages pass, zero failures
  • golangci-lint run — zero issues
  • TestTreeSitterChunker_Dart_Comprehensive — verifies chunking of classes, methods, mixins, enums, extensions, typedefs
  • TestAdversarial_Dart — verifies edge cases and false positive exclusion
  • TestAdversarial_ChunkInvariants — includes .dart in cross-language invariant checks
  • TestDefaultLanguages_AllExtensionsPresent — verifies .dart registered
  • No regressions in existing language tests (Python, Java, PHP, TS, JS, etc.)
  • TestLang_Dart E2E snapshot test (requires Ollama with embedding model)
  • bench-swe Dart task run with both scenarios

🤖 Generated with Claude Code

aeneasr and others added 2 commits March 27, 2026 19:10
Add full Dart language support via tree-sitter grammar from
go-sitter-forest/dart. Includes chunker registration with 11 query
patterns covering classes, mixins, enums, extensions, functions,
methods, typedefs, and constructors.

Closes #60

- Register .dart extension with tree-sitter query patterns
- Add findEnclosingSymbol support for Dart class_body/extension_body
  (scoped to Dart-specific parent types to avoid Python/Java/TS impact)
- Unit test with comprehensive Dart sample code
- Adversarial test covering async, generators, sealed/abstract classes,
  factory/named constructors, enhanced enums, comment exclusions
- E2E snapshot test with 18 fixture files from dart-lang/shelf
- bench-swe task using shelf_router HEAD content-length RFC bug
- Benchmark results: 76% cheaper, 79% faster, 84% fewer tokens with lumen

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Dart showed the strongest benchmark results across all 9 languages:
76% cost reduction, 79% time reduction, 82% fewer output tokens.
Update all summary tables, per-language rankings, and the supported
languages table in README.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aeneasr
Copy link
Copy Markdown
Member Author

aeneasr commented Mar 27, 2026

@jkoenig134 the numbers looks pretty good :D

@jkoenig134
Copy link
Copy Markdown

@aeneasr wow, awesome!!

@aeneasr aeneasr enabled auto-merge (squash) March 27, 2026 18:38
aeneasr and others added 2 commits March 27, 2026 20:05
Snapshots were missing from the initial Dart implementation commit,
causing CI to fail on first run (cupaloy creates snapshots and fails).
Captured from CI run #23661290108.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@aeneasr aeneasr merged commit 00a985b into main Mar 28, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dart Support

2 participants