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

Method extract_method

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

Source from the content-addressed store, hash-verified

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

Callers 1

extract_functionMethod · 0.45

Calls 5

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

Tested by

no test coverage detected