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

Method extract_class

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

Source from the content-addressed store, hash-verified

885 }
886
887 fn extract_class(&mut self, node: Node<'t>) {
888 stack_guard!();
889 let name = self.extract_name(node);
890 let extra = Extra {
891 docstring: preceding_docstring(node, self.src),
892 visibility: Some(self.visibility_of(node)),
893 ..Extra::default()
894 };
895 let Some(row) = self.create_node("class", &name, node, extra) else { return };
896 self.extract_inheritance(node, row);
897 // primaryCtor refs: csharp-only (no parameter_list child type).
898 // Classes DO get decorates (`@Observable class`), unlike struct/enum.
899 self.extract_decorators_for(node, row);
900 self.stack.push(Scope { row, kind: "class", name });
901 let body = node.child_by_field_name("body").unwrap_or(node);
902 for c in body.named_children(&mut body.walk()) {
903 self.visit_node(c);
904 }
905 self.stack.pop();
906 }
907
908 fn extract_struct(&mut self, node: Node<'t>) {
909 stack_guard!();

Callers 2

visit_nodeMethod · 0.45

Calls 9

preceding_docstringFunction · 0.85
pushMethod · 0.80
extract_nameMethod · 0.45
visibility_ofMethod · 0.45
create_nodeMethod · 0.45
extract_inheritanceMethod · 0.45
walkMethod · 0.45
visit_nodeMethod · 0.45

Tested by

no test coverage detected