Skip to content

Graphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.

feat(core): register dart LanguageConfig

thejesh62932684c61b
diff --git a/understand-anything-plugin/packages/core/package.json b/understand-anything-plugin/packages/core/package.json
index 7ea50ae6..e54ce728 100644
--- a/understand-anything-plugin/packages/core/package.json
+++ b/understand-anything-plugin/packages/core/package.json
@@ -38,6 +38,7 @@
},
"dependencies": {
"@tree-sitter-grammars/tree-sitter-kotlin": "1.1.0",
+ "@understand-anything/tree-sitter-dart-wasm": "workspace:*",
"fuse.js": "^7.1.0",
"ignore": "^7.0.5",
"tree-sitter-c-sharp": "^0.23.1",
diff --git a/understand-anything-plugin/packages/core/src/__tests__/language-registry.test.ts b/understand-anything-plugin/packages/core/src/__tests__/language-registry.test.ts
index 7a3c7749..4ecad11b 100644
--- a/understand-anything-plugin/packages/core/src/__tests__/language-registry.test.ts
+++ b/understand-anything-plugin/packages/core/src/__tests__/language-registry.test.ts
@@ -49,10 +49,10 @@ describe("LanguageRegistry", () => {
});
describe("createDefault", () => {
- it("registers all 40 built-in language configs", () => {
+ it("registers all 41 built-in language configs", () => {
const registry = LanguageRegistry.createDefault();
const all = registry.getAllLanguages();
- expect(all.length).toBe(40);
+ expect(all.length).toBe(41);
});
it("maps all expected extensions", () => {
diff --git a/understand-anything-plugin/packages/core/src/languages/configs/dart.ts b/understand-anything-plugin/packages/core/src/languages/configs/dart.ts
new file mode 100644
index 00000000..2d94a23b
--- /dev/null
+++ b/understand-anything-plugin/packages/core/src/languages/configs/dart.ts
@@ -0,0 +1,29 @@
+import type { LanguageConfig } from "../types.js";
+
+export const dartConfig = {
+ id: "dart",
+ displayName: "Dart",
+ extensions: [".dart"],
+ treeSitter: {
+ wasmPackage: "@understand-anything/tree-sitter-dart-wasm",
+ wasmFile: "tree-sitter-dart.wasm",
+ },
+ concepts: [
+ "null safety",
+ "mixins",
+ "extensions",
+ "isolates",
+ "async/await",
+ "streams",
+ "factory constructors",
+ "named constructors",
+ "records",
+ "sealed classes",
+ ],
+ filePatterns: {
+ entryPoints: ["lib/main.dart", "bin/*.dart"],
+ barrels: ["lib/*.dart"],
+ tests: ["test/**/*_test.dart"],
+ config: ["pubspec.yaml", "analysis_options.yaml"],
+ },
+} satisfies LanguageConfig;
diff --git a/understand-anything-plugin/packages/core/src/languages/configs/index.ts b/understand-anything-plugin/packages/core/src/languages/configs/index.ts
index 4893c4d5..6a949e89 100644
--- a/understand-anything-plugin/packages/core/src/languages/configs/index.ts
+++ b/understand-anything-plugin/packages/core/src/languages/configs/index.ts
@@ -11,6 +11,7 @@ import { swiftConfig } from "./swift.js";
import { kotlinConfig } from "./kotlin.js";
import { cConfig } from "./c.js";
import { cppConfig } from "./cpp.js";
+import { dartConfig } from "./dart.js";
import { csharpConfig } from "./csharp.js";
import { luaConfig } from "./lua.js";
// Non-code language configs
@@ -56,6 +57,7 @@ export const builtinLanguageConfigs: LanguageConfig[] = [
luaConfig,
cConfig,
cppConfig,
+ dartConfig,
csharpConfig,
// Non-code languages
markdownConfig,
@@ -101,6 +103,7 @@ export {
luaConfig,
cConfig,
cppConfig,
+ dartConfig,
csharpConfig,
// Non-code languages
markdownConfig,
diff --git a/understand-anything-plugin/pnpm-lock.yaml b/understand-anything-plugin/pnpm-lock.yaml
index 23c375d4..e885e212 100644
--- a/understand-anything-plugin/pnpm-lock.yaml
+++ b/understand-anything-plugin/pnpm-lock.yaml
@@ -33,6 +33,9 @@ importers:
'@tree-sitter-grammars/tree-sitter-kotlin':
specifier: 1.1.0
version: 1.1.0
+ '@understand-anything/tree-sitter-dart-wasm':
+ specifier: workspace:*
+ version: link:../tree-sitter-dart-wasm
fuse.js:
specifier: ^7.1.0
version: 7.1.0