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

Method extract_class

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

Source from the content-addressed store, hash-verified

626 // --- extractors --------------------------------------------------------------
627
628 fn extract_class(&mut self, node: Node<'t>) {
629 // skipBodilessClass unset: a bodiless `record Empty;` still mints a node.
630 let name = self.extract_name(node);
631 let extra = Extra {
632 docstring: preceding_docstring(node, self.src),
633 visibility: Some(self.visibility_of(node)),
634 ..Extra::default() // isExported hook absent → flag not present
635 };
636 let Some(row) = self.create_node("class", &name, node, extra) else { return };
637 self.extract_inheritance(node, row);
638 self.extract_primary_ctor_param_refs(node, row);
639 // extractDecoratorsFor: C# attributes never match its accepted node
640 // types (attribute_list is skipped, its children never reached) —
641 // zero `decorates` refs; the call slot emits nothing.
642
643 self.stack.push(Scope { row, kind: "class", name });
644 // body ?? node: a bodiless record's own children are iterated
645 // "harmlessly" — visit_node on identifier/parameter_list/base_list
646 // children falls through (base-arg identifiers still feed fn-ref
647 // capture, mirroring the TS walk).
648 let body = node.child_by_field_name("body").unwrap_or(node);
649 for i in 0..body.named_child_count() {
650 if let Some(c) = body.named_child(i) {
651 self.visit_node(c);
652 }
653 }
654 // no synthesizeMembers for C#
655 self.stack.pop();
656 }
657
658 fn extract_struct(&mut self, node: Node<'t>) {
659 // Body gate — EXCEPT C# positional records (`record struct M(…);`,

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