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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user