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

Method extract_method

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

Source from the content-addressed store, hash-verified

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

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