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

Method extract_class

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

Source from the content-addressed store, hash-verified

770 // --- extractClass (:1679) — classes, mixins, extensions ---------------
771
772 fn extract_class(&mut self, node: Node<'t>) {
773 let resolved_body = self.resolve_body(node);
774 // No skipBodilessClass. Anonymous `extension on String` → the name
775 // fallback finds the ON type's type_identifier — a class named after
776 // the extended type (preserved).
777 let name = self.extract_name(node);
778 let docstring = preceding_docstring(node, self.src);
779 let visibility = self.visibility_of(node);
780 let row = self.create_node(
781 "class",
782 &name,
783 node,
784 Extra { docstring, visibility, ..Default::default() },
785 );
786 let Some(row) = row else { return };
787 self.extract_inheritance(node, row);
788 // extractCsharpPrimaryCtorParamRefs — csharp-gated no-op.
789 self.extract_decorators_for(node, row);
790 self.stack.push(Scope { row, kind: "class", name });
791 let body = resolved_body.unwrap_or(node);
792 let mut cursor = body.walk();
793 let children: Vec<Node<'t>> = body.named_children(&mut cursor).collect();
794 for child in children {
795 self.visit(child);
796 }
797 self.stack.pop();
798 }
799
800 // --- extractEnum (:1914) ----------------------------------------------
801

Callers 1

visitMethod · 0.45

Calls 9

preceding_docstringFunction · 0.85
resolve_bodyMethod · 0.45
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