Skip to content

feat: add dart support#10

Open
levnikmyskin wants to merge 1 commit intocytostack:mainfrom
levnikmyskin:main
Open

feat: add dart support#10
levnikmyskin wants to merge 1 commit intocytostack:mainfrom
levnikmyskin:main

Conversation

@levnikmyskin
Copy link
Copy Markdown

Hi!
I'm simply adding support for the dart language

smk508 added a commit to smk508/openwolf that referenced this pull request Apr 11, 2026
Adds Flutter-critical languages (Kotlin, Swift, Objective-C) plus
common gaps (C++ variants, C#, Ruby, PHP, Lua, Vue, Svelte, HTML,
Protobuf, GraphQL, Terraform, shell variants) to both extension sets.

Also brings src/tracker/token-estimator.ts CODE_EXTS back in sync with
src/scanner/anatomy-scanner.ts CODE_EXTENSIONS — the two sets had
drifted apart since only CODE_EXTENSIONS gets the .dart addition from
cytostack#10. Adds a one-line "Keep in sync with ..." comment above each so
future additions hit both places.

These sets control the chars-per-token ratio (3.5 for code vs 3.75
fallback) used by estimateTokens; the net effect is ~7% more accurate
token accounting in anatomy.md and detectContentType() consumers for
projects written in these languages.
@smk508
Copy link
Copy Markdown

smk508 commented Apr 11, 2026

Hey @levnikmyskin — thanks for catching this, the Dart omission genuinely bugged me too (I work in Flutter, so my anatomy scans were quietly under-counting my whole lib/ tree).

Heads up that I just opened a stacked follow-up on top of your commit that pulls in the rest of the Flutter toolchain (.kt, .kts, .swift, .m, .mm) plus some other common gaps (C++ variants, C#, Ruby, PHP, Vue/Svelte, Protobuf, Terraform, shell variants). I'll link it here once it's up.

One thing I noticed while writing it: there's actually a second near-identical extension set at src/tracker/token-estimator.ts:3 (CODE_EXTS) that feeds the exported detectContentType() helper. Your PR touches only the one in anatomy-scanner.ts, so the two sets have drifted apart — .dart will classify as "code" for anatomy scans but still fall through to "mixed" for anything consuming detectContentType(). My stacked PR syncs them and adds a // Keep in sync with ... comment above each so the coupling is visible going forward.

If you'd rather fold that fix into #10 directly and keep ownership of the full change, happy to close my follow-up — just let me know. Otherwise I'll leave it stacked so both commits land together.

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.

2 participants