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

Method extract_enum

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

Source from the content-addressed store, hash-verified

765 // --- extractEnum (:1914) ----------------------------------------------
766
767 fn extract_enum(&mut self, node: Node<'t>) {
768 let body = match node.child_by_field_name("body") {
769 Some(b) => b,
770 None => return, // bodiless enum mints nothing
771 };
772 let name = self.extract_name(node);
773 let docstring = preceding_docstring(node, self.src);
774 let visibility = self.visibility_of(node);
775 let row = self.create_node(
776 "enum",
777 &name,
778 node,
779 Extra { docstring, visibility, ..Default::default() },
780 );
781 let Some(row) = row else { return };
782 self.extract_inheritance(node, row);
783 // No extractDecoratorsFor on the enum path (annotated enums emit no
784 // decorates — shared-pipeline behavior).
785 self.stack.push(Scope { row, kind: "enum", name });
786 // enumMemberTypes is EMPTY → every body child goes through visitNode
787 // (enum_case_definitions hits the hook; defs become methods).
788 let mut cursor = body.walk();
789 let children: Vec<Node<'t>> = body.named_children(&mut cursor).collect();
790 for child in children {
791 self.visit(child);
792 }
793 self.stack.pop();
794 }
795
796 // --- extractTypeAlias (:2890, plain path :2967-2991) ------------------
797

Callers 2

visitMethod · 0.45
visit_bodyMethod · 0.45

Calls 7

preceding_docstringFunction · 0.85
extract_nameMethod · 0.45
visibility_ofMethod · 0.45
create_nodeMethod · 0.45
extract_inheritanceMethod · 0.45
collectMethod · 0.45
visitMethod · 0.45

Tested by

no test coverage detected