From 7bd9eb5308eb6201515ff03f8007c512812824aa Mon Sep 17 00:00:00 2001 From: Giancarlo Erra Date: Thu, 11 Jun 2026 12:12:18 +0100 Subject: [PATCH 1/2] feat(graph): full Dart support via tree-sitter AST (#71) Dart previously fell through to the regex symbol fallback, which cannot match type-first signatures (void foo(), Future baz() async), so classes, methods, and calls were invisible to codebase_symbol, codebase_flow, and codebase_impact, and files were chunked by line count instead of declaration boundaries. - Register @ast-grep/lang-dart as a dynamic grammar (per-grammar failure isolation keeps missing prebuilds on the regex fallback). - Add extractFromDart: classes, mixins (trait), enums, extensions, typedefs, type-first top-level functions, getters/setters, and constructors including named and factory forms. Scope ranges are stitched from Dart's sibling function_signature/function_body pairs. Calls are recovered from argument_part nodes: method calls, bare calls, constructor invocations, prefixed calls, and cascades. - Add dart to TOP_LEVEL_KINDS so chunking follows declaration boundaries; signature and body kinds are both listed so the overlap-merge fuses each pair into one region. - Add dart main() to ENTRY_POINT_NAMES for entry-point detection. - Move Dart to Full Support in the README language matrix. --- README.md | 6 +- package-lock.json | 19 +++ package.json | 1 + src/constants.ts | 1 + src/services/code-graph.ts | 1 + src/services/graph-symbols.ts | 210 ++++++++++++++++++++++++++- src/services/indexer.ts | 5 + tests/unit/graph-entrypoints.test.ts | 22 +++ tests/unit/graph-symbols.test.ts | 120 +++++++++++++-- tests/unit/indexer.test.ts | 42 ++++++ 10 files changed, 413 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index b5035fe..b9948e9 100644 --- a/README.md +++ b/README.md @@ -959,13 +959,15 @@ SocratiCode supports languages at three levels: ### Full Support (indexing + code graph + AST chunking) -JavaScript, TypeScript, TSX, Python, Java, Kotlin, Scala, C, C++, C#, Go, Rust, Ruby, PHP, Swift, Bash/Shell, HTML, CSS/SCSS, Svelte, Vue +JavaScript, TypeScript, TSX, Python, Java, Kotlin, Scala, C, C++, C#, Go, Rust, Ruby, PHP, Swift, Dart, Bash/Shell, HTML, CSS/SCSS, Svelte, Vue Svelte and Vue: imports extracted from `