From 902cb0ef9dca62a15c1321089effd963b5e38df3 Mon Sep 17 00:00:00 2001 From: Colby McHenry Date: Mon, 6 Apr 2026 19:13:57 -0500 Subject: [PATCH] feat: Add Go selector_expression support to function call extraction Addresses Go's tree-sitter parsing where method calls use selector_expression nodes with 'field' children instead of member_expression nodes with 'property' children. Extends function call extraction to handle Go's obj.method() syntax alongside existing JavaScript/TypeScript support. --- src/extraction/tree-sitter.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/extraction/tree-sitter.ts b/src/extraction/tree-sitter.ts index bf15abc..98991b1 100644 --- a/src/extraction/tree-sitter.ts +++ b/src/extraction/tree-sitter.ts @@ -1134,9 +1134,10 @@ export class TreeSitterExtractor { const func = getChildByField(node, 'function') || node.namedChild(0); if (func) { - if (func.type === 'member_expression' || func.type === 'attribute') { - // Method call: obj.method() - const property = getChildByField(func, 'property') || func.namedChild(1); + if (func.type === 'member_expression' || func.type === 'attribute' || func.type === 'selector_expression') { + // Method call: obj.method() or obj.field.method() + // Go uses selector_expression with 'field', JS/TS uses member_expression with 'property' + const property = getChildByField(func, 'property') || getChildByField(func, 'field') || func.namedChild(1); if (property) { calleeName = getNodeText(property, this.source); }