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

Method extract_class

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

Source from the content-addressed store, hash-verified

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

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