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

Method extract_struct

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

Source from the content-addressed store, hash-verified

906 }
907
908 fn extract_struct(&mut self, node: Node<'t>) {
909 stack_guard!();
910 // Body gate (:1876) — bodiless mints nothing (record exemption is C#).
911 let Some(body) = node.child_by_field_name("body") else { return };
912 let name = self.extract_name(node);
913 let extra = Extra {
914 docstring: preceding_docstring(node, self.src),
915 visibility: Some(self.visibility_of(node)),
916 ..Extra::default()
917 };
918 let Some(row) = self.create_node("struct", &name, node, extra) else { return };
919 self.extract_inheritance(node, row);
920 // NO extractDecoratorsFor for structs (`@main struct` emits nothing).
921 self.stack.push(Scope { row, kind: "struct", name });
922 for c in body.named_children(&mut body.walk()) {
923 self.visit_node(c);
924 }
925 self.stack.pop();
926 }
927
928 fn extract_enum(&mut self, node: Node<'t>) {
929 stack_guard!();

Callers 2

visit_nodeMethod · 0.45

Calls 8

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