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

Method extract_enum

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

Source from the content-addressed store, hash-verified

790 // --- extractEnum (:1914) ----------------------------------------------
791
792 fn extract_enum(&mut self, node: Node<'t>) {
793 stack_guard!();
794 let body = match node.child_by_field_name("body") {
795 Some(b) => b,
796 None => return, // bodiless enum mints nothing
797 };
798 let name = self.extract_name(node);
799 let docstring = preceding_docstring(node, self.src);
800 let visibility = self.visibility_of(node);
801 let row = self.create_node(
802 "enum",
803 &name,
804 node,
805 Extra { docstring, visibility, ..Default::default() },
806 );
807 let Some(row) = row else { return };
808 self.extract_inheritance(node, row);
809 // No extractDecoratorsFor on the enum path (annotated enums emit no
810 // decorates — shared-pipeline behavior).
811 self.stack.push(Scope { row, kind: "enum", name });
812 // enumMemberTypes is EMPTY → every body child goes through visitNode
813 // (enum_case_definitions hits the hook; defs become methods).
814 let mut cursor = body.walk();
815 let children: Vec<Node<'t>> = body.named_children(&mut cursor).collect();
816 for child in children {
817 self.visit(child);
818 }
819 self.stack.pop();
820 }
821
822 // --- extractTypeAlias (:2890, plain path :2967-2991) ------------------
823

Callers 2

visitMethod · 0.45
visit_bodyMethod · 0.45

Calls 9

preceding_docstringFunction · 0.85
pushMethod · 0.80
walkMethod · 0.80
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