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.
TypeScript antigravity-skillsbusiness-knowledgeclaude-codeclaude-skillscodebase-analysiscodexcodex-skillsdeveloper-tools-ai-agentgemini-cli-skillskarpathy-llm-wikiknowledge-baseknowledge-graphmemoryopencode-skillspi-agentunderstandcodevibe-coding
test(core): DartExtractor — visibility rule (underscore prefix)
thejesh23d6b1a39c36
diff --git a/understand-anything-plugin/packages/core/src/plugins/extractors/__tests__/dart-extractor.test.ts b/understand-anything-plugin/packages/core/src/plugins/extractors/__tests__/dart-extractor.test.tsindex 9954743b..b6c54016 100644--- a/understand-anything-plugin/packages/core/src/plugins/extractors/__tests__/dart-extractor.test.ts+++ b/understand-anything-plugin/packages/core/src/plugins/extractors/__tests__/dart-extractor.test.ts@@ -327,4 +327,46 @@ describe("DartExtractor", () => {parser.delete();});});++ describe("extractStructure - visibility", () => {+ it("does NOT export a top-level declaration whose name starts with _", () => {+ const { tree, parser, root } = parse(`int _helper() => 1;+class _PrivateImpl {}+`);+ const result = extractor.extractStructure(root);++ const names = result.exports.map((e) => e.name);+ expect(names).not.toContain("_helper");+ expect(names).not.toContain("_PrivateImpl");+ tree.delete();+ parser.delete();+ });++ it("DOES export a top-level declaration without an underscore prefix", () => {+ const { tree, parser, root } = parse(`int helper() => 1;+class Public {}+`);+ const result = extractor.extractStructure(root);++ const names = result.exports.map((e) => e.name);+ expect(names).toEqual(expect.arrayContaining(["helper", "Public"]));+ tree.delete();+ parser.delete();+ });++ it("does NOT export class members whose names start with _", () => {+ const { tree, parser, root } = parse(`class Counter {+ void _helper() {}+ void publicMethod() {}+}+`);+ const result = extractor.extractStructure(root);++ const names = result.exports.map((e) => e.name);+ expect(names).toContain("publicMethod");+ expect(names).not.toContain("_helper");+ tree.delete();+ parser.delete();+ });+ });});