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
+8
View File
@@ -198,4 +198,12 @@ export interface LanguageExtractor {
* structural nodes (classes, structs, enums).
*/
isMisparsedFunction?: (name: string, node: SyntaxNode) => boolean;
/**
* Detect bare method calls that don't use call expression syntax.
* Used by Ruby where `reset` (no parens, no receiver) is a method call but
* tree-sitter parses it as a plain `identifier` node instead of `call`/`method_call`.
* Returns the callee name if this node is a bare call, or undefined if not.
*/
extractBareCall?: (node: SyntaxNode, source: string) => string | undefined;
}