feat: Add Ruby bare method call extraction for identifier nodes

Addresses Ruby bare method calls like `reset` that parse as identifier nodes instead of call expressions. Adds extractBareCall hook to detect statement-level identifiers that represent method calls, filtering out keywords, literals, and constants. Enables proper call relationship tracking for Ruby's parentheses-optional method syntax.
This commit is contained in:
Colby McHenry
2026-04-07 09:27:00 -05:00
parent 59ea5a43be
commit 9382a087f4
3 changed files with 51 additions and 0 deletions
+14
View File
@@ -1391,6 +1391,20 @@ export class TreeSitterExtractor {
if (this.extractor!.callTypes.includes(nodeType)) {
this.extractCall(node);
} else if (this.extractor!.extractBareCall) {
const calleeName = this.extractor!.extractBareCall(node, this.source);
if (calleeName && this.nodeStack.length > 0) {
const callerId = this.nodeStack[this.nodeStack.length - 1];
if (callerId) {
this.unresolvedReferences.push({
fromNodeId: callerId,
referenceName: calleeName,
referenceKind: 'calls',
line: node.startPosition.row + 1,
column: node.startPosition.column,
});
}
}
}
// Extract structural nodes found inside function bodies.