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

Method extract_method

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

Source from the content-addressed store, hash-verified

525 }
526
527 fn extract_method(&mut self, node: Node<'t>, receiver: String) {
528 stack_guard!();
529 let name = self.extract_name(node);
530 let docstring = preceding_docstring(node, self.src);
531 let signature = self.signature_of(node);
532 // extractMethod passes NO isExported — absent for BOTH dialects.
533 // QN override (:1790-1792): `receiver::name` verbatim (namespacePrefix
534 // is empty outside C++).
535 let qn = format!("{receiver}::{name}");
536 let method_row = self.create_node(
537 "method",
538 &name,
539 node,
540 Extra {
541 docstring,
542 signature,
543 qualified_name_override: Some(qn),
544 ..Default::default()
545 },
546 );
547 let Some(row) = method_row else { return };
548 // Owner-contains (:1799-1813) never fires: lua mints no
549 // struct/class/enum/trait nodes for a receiver name to match.
550 self.stack.push(Scope { row, kind: "method", name });
551 if let Some(body) = node.child_by_field_name("body") {
552 self.visit_body(body);
553 }
554 self.stack.pop();
555 }
556
557 // --- extractVariable — the lua/luau branch (2538-2549, 2789-2805) -----
558

Callers 1

extract_functionMethod · 0.45

Calls 6

preceding_docstringFunction · 0.85
pushMethod · 0.80
extract_nameMethod · 0.45
signature_ofMethod · 0.45
create_nodeMethod · 0.45
visit_bodyMethod · 0.45

Tested by

no test coverage detected