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

Method extract_enum

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

Source from the content-addressed store, hash-verified

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

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