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

Method extract_class

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

Source from the content-addressed store, hash-verified

823 }
824
825 fn extract_class(&mut self, node: Node<'t>) {
826 let name = self.extract_name(node);
827 let extra = Extra {
828 docstring: preceding_docstring(node, self.src),
829 visibility: Some(self.visibility_of(node)),
830 ..Extra::default()
831 };
832 let Some(row) = self.create_node("class", &name, node, extra) else { return };
833 self.extract_inheritance(node, row);
834 // primaryCtor refs: csharp-only (no parameter_list child type).
835 // Classes DO get decorates (`@Observable class`), unlike struct/enum.
836 self.extract_decorators_for(node, row);
837 self.stack.push(Scope { row, kind: "class", name });
838 let body = node.child_by_field_name("body").unwrap_or(node);
839 for i in 0..body.named_child_count() {
840 if let Some(c) = body.named_child(i) {
841 self.visit_node(c);
842 }
843 }
844 self.stack.pop();
845 }
846
847 fn extract_struct(&mut self, node: Node<'t>) {
848 // Body gate (:1876) — bodiless mints nothing (record exemption is C#).

Callers 2

visit_nodeMethod · 0.45

Calls 7

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