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

Method extract_class

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

Source from the content-addressed store, hash-verified

594 // --- extractors --------------------------------------------------------------
595
596 fn extract_class(&mut self, node: Node<'t>) {
597 stack_guard!();
598 let name = self.extract_name(node);
599 let extra = Extra {
600 docstring: preceding_docstring(node, self.src),
601 visibility: self.visibility_of(node),
602 ..Extra::default() // java has no isExported hook
603 };
604 let Some(row) = self.create_node("class", &name, node, extra) else { return };
605 self.extract_inheritance(node, row);
606 self.extract_decorators_for(node, row);
607
608 self.stack.push(Scope { row, kind: "class", name });
609 let body = node.child_by_field_name("body").unwrap_or(node);
610 for i in 0..body.named_child_count() {
611 if let Some(c) = body.named_child(i) {
612 self.visit_node(c);
613 }
614 }
615 // synthesizeJavaMembers — class still on the stack: record
616 // components first, then Lombok (#912).
617 if node.kind() == "record_declaration" {
618 self.synthesize_record_components(node, row);
619 }
620 self.synthesize_lombok_members(node, row);
621 self.stack.pop();
622 }
623
624 fn extract_method(&mut self, node: Node<'t>) {
625 stack_guard!();

Callers 2

visit_nodeMethod · 0.45

Calls 10

preceding_docstringFunction · 0.85
pushMethod · 0.80
extract_nameMethod · 0.45
visibility_ofMethod · 0.45
create_nodeMethod · 0.45
extract_inheritanceMethod · 0.45
visit_nodeMethod · 0.45

Tested by

no test coverage detected