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

Method extract_method

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

Source from the content-addressed store, hash-verified

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

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