Add Dart support#56
Conversation
|
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. |
|
@1st1 any chance we get this sorted out? Would be really useful for us! |
|
I could clean this up by adding modern dart support to tree-sitter-wasms. |
|
@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? |
|
Yep, some |
good catch! Will do! |
| } | ||
| } | ||
| } else if (node.type === 'static_final_declaration_list') { | ||
| // Top-level `final x = ...` or `const x = ...` — the list contains |
There was a problem hiding this comment.
Maybe you can extend the extraction to var-types var x = ..., typed such as String x = ... and late int x = ... declarations?
Summary
.dart) as a supported language for source code wiki links and// @lat:code referencesfinal/constvariablesDetails
Source parser (
src/source-parser.ts):tree-sitter-dart.wasmgrammar mapping for.dartfilesextractDartSymbols()andextractDartClassMembers()with adartName()helper that handles the Dart grammar's varying approaches to name fields (some nodes use anamefield, others have a plainidentifierchild)interface-kind symbols; enums and extensions asclass-kindRefs (
src/cli/refs.ts): Added.dartto 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 incases.test.ts.Test plan
pnpm build— compiles without errorspnpm vitest run tests/cases.test.ts -t "dart"— both Dart tests passlat check— all checks pass@repomix/tree-sitter-wasmsincludestree-sitter-dart.wasm(works with current installed version)