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

Method extract_call

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

Source from the content-addressed store, hash-verified

754 // --- extractCall (3684; generic tail 4313, 4518-4532, 4572-4580) ------
755
756 fn extract_call(&mut self, node: Node<'t>) {
757 if self.stack.is_empty() {
758 return;
759 }
760 let caller_row = self.top_row();
761 // The `function` field is NULL in this grammar → namedChild(0) (the
762 // `name:` child). Member branch never fires (dot/method_index aren't
763 // in its type list) → raw source text, then the paren-conversion.
764 let func = node
765 .child_by_field_name("function")
766 .or_else(|| node.named_child(0));
767 let Some(func) = func else { return };
768 let mut callee: &str = self.text(func);
769 if let Some(caps) = util::paren_conversion().captures(callee) {
770 if let Some(inner) = caps.get(1) {
771 callee = &callee[inner.range()];
772 }
773 }
774 if callee.is_empty() {
775 return;
776 }
777 let callee = callee.to_string();
778 self.push_ref_at(caller_row, &callee, "calls", node);
779 }
780
781 // --- visitFunctionBody (5129-5286) — the hook-free body walk ----------
782

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