MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / extract_call

Method extract_call

codegraph-kernel/src/lua.rs:632–655  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

630 // --- extractCall (3684; generic tail 4313, 4518-4532, 4572-4580) ------
631
632 fn extract_call(&mut self, node: Node<'t>) {
633 if self.stack.is_empty() {
634 return;
635 }
636 let caller_row = self.top_row();
637 // The `function` field is NULL in this grammar → namedChild(0) (the
638 // `name:` child). Member branch never fires (dot/method_index aren't
639 // in its type list) → raw source text, then the paren-conversion.
640 let func = node
641 .child_by_field_name("function")
642 .or_else(|| node.named_child(0));
643 let Some(func) = func else { return };
644 let mut callee: &str = self.text(func);
645 if let Some(caps) = util::paren_conversion().captures(callee) {
646 if let Some(inner) = caps.get(1) {
647 callee = &callee[inner.range()];
648 }
649 }
650 if callee.is_empty() {
651 return;
652 }
653 let callee = callee.to_string();
654 self.push_ref_at(caller_row, &callee, "calls", node);
655 }
656
657 // --- visitFunctionBody (5129-5286) — the hook-free body walk ----------
658

Callers 2

visitMethod · 0.45
visit_bodyMethod · 0.45

Calls 4

textMethod · 0.65
getMethod · 0.65
top_rowMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected