Skip to content

Add Dart support#56

Open
jkoenig134 wants to merge 6 commits into
1st1:mainfrom
elea-ai:dart_support
Open

Add Dart support#56
jkoenig134 wants to merge 6 commits into
1st1:mainfrom
elea-ai:dart_support

Conversation

@jkoenig134

Copy link
Copy Markdown

Summary

  • Add Dart (.dart) as a supported language for source code wiki links and // @lat: code references
  • Parse Dart symbols via tree-sitter: functions, classes, methods, mixins, enums, extensions, and top-level final/const variables
  • Add test cases for valid symbol resolution and missing symbol error reporting

Details

Source parser (src/source-parser.ts):

  • Added tree-sitter-dart.wasm grammar mapping for .dart files
  • Implemented extractDartSymbols() and extractDartClassMembers() with a dartName() helper that handles the Dart grammar's varying approaches to name fields (some nodes use a name field, others have a plain identifier child)
  • Dart mixins are emitted as interface-kind symbols; enums and extensions as class-kind

Refs (src/cli/refs.ts): Added .dart to the recognized source extensions set.

Docs: Updated lat.md/markdown.md, CLAUDE.md, AGENTS.md, and both templates with Dart examples and extension lists.

Tests: Two new test case directories (source-ref-dart-valid, error-source-ref-dart-missing) and corresponding test describes in cases.test.ts.

Test plan

  • pnpm build — compiles without errors
  • pnpm vitest run tests/cases.test.ts -t "dart" — both Dart tests pass
  • lat check — all checks pass
  • Verified that @repomix/tree-sitter-wasms includes tree-sitter-dart.wasm (works with current installed version)

Built with the help of Claude Code.

@vercel

vercel Bot commented Apr 8, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Yury Selivanov's projects Team on Vercel.

A member of the Team first needs to authorize it.

@jkoenig134

Copy link
Copy Markdown
Author

@1st1 any chance we get this sorted out? Would be really useful for us!

@jkoenig134

Copy link
Copy Markdown
Author

I could clean this up by adding modern dart support to tree-sitter-wasms.

@lars20070

Copy link
Copy Markdown
Contributor

@jkoenig134 Could you add some Dart test code as done for TypeScript and Python?

@jkoenig134

jkoenig134 commented May 4, 2026

Copy link
Copy Markdown
Author

@jkoenig134 Could you add some Dart test code as done for TypeScript and Python?

Can't really follow you .. there already is dart test code

Or do you refer to references in code to md?

@lars20070

Copy link
Copy Markdown
Contributor

Yep, some # @lat: in the test code.

@jkoenig134

Copy link
Copy Markdown
Author

Yep, some # @lat: in the test code.

good catch! Will do!

Comment thread src/source-parser.ts
}
}
} else if (node.type === 'static_final_declaration_list') {
// Top-level `final x = ...` or `const x = ...` — the list contains

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you can extend the extraction to var-types var x = ..., typed such as String x = ... and late int x = ... declarations?

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