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.

fix(core): capture abstract method signatures in TypeScript classes

jiang4wqy4ae6de504dfa
diff --git a/understand-anything-plugin/packages/core/src/plugins/extractors/__tests__/typescript-extractor.test.ts b/understand-anything-plugin/packages/core/src/plugins/extractors/__tests__/typescript-extractor.test.ts
index 344bc34a..b9e64e27 100644
--- a/understand-anything-plugin/packages/core/src/plugins/extractors/__tests__/typescript-extractor.test.ts
+++ b/understand-anything-plugin/packages/core/src/plugins/extractors/__tests__/typescript-extractor.test.ts
@@ -62,6 +62,8 @@ describe("TypeScriptExtractor", () => {
const repo = result.classes.find((c) => c.name === "Repository");
expect(repo).toBeDefined();
expect(repo!.methods).toContain("save");
+ // abstract method signatures (no body) are captured too
+ expect(repo!.methods).toContain("find");
tree.delete();
parser.delete();
diff --git a/understand-anything-plugin/packages/core/src/plugins/extractors/typescript-extractor.ts b/understand-anything-plugin/packages/core/src/plugins/extractors/typescript-extractor.ts
index 8f8aebb9..d1648948 100644
--- a/understand-anything-plugin/packages/core/src/plugins/extractors/typescript-extractor.ts
+++ b/understand-anything-plugin/packages/core/src/plugins/extractors/typescript-extractor.ts
@@ -285,7 +285,10 @@ export class TypeScriptExtractor implements LanguageExtractor {
const member = classBody.child(j);
if (!member) continue;
- if (member.type === "method_definition") {
+ if (
+ member.type === "method_definition" ||
+ member.type === "abstract_method_signature"
+ ) {
const methodName = member.children.find(
(c) => c.type === "property_identifier",
);