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

Method extract_class

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

Source from the content-addressed store, hash-verified

694 // --- extractors --------------------------------------------------------------
695
696 fn extract_class(&mut self, node: Node<'t>) {
697 stack_guard!();
698 // skipBodilessClass unset: a bodiless `record Empty;` still mints a node.
699 let name = self.extract_name(node);
700 let extra = Extra {
701 docstring: preceding_docstring(node, self.src),
702 visibility: Some(self.visibility_of(node)),
703 ..Extra::default() // isExported hook absent → flag not present
704 };
705 let Some(row) = self.create_node("class", &name, node, extra) else { return };
706 self.extract_inheritance(node, row);
707 self.extract_primary_ctor_param_refs(node, row);
708 // extractDecoratorsFor: C# attributes never match its accepted node
709 // types (attribute_list is skipped, its children never reached) —
710 // zero `decorates` refs; the call slot emits nothing.
711
712 self.stack.push(Scope { row, kind: "class", name });
713 // body ?? node: a bodiless record's own children are iterated
714 // "harmlessly" — visit_node on identifier/parameter_list/base_list
715 // children falls through (base-arg identifiers still feed fn-ref
716 // capture, mirroring the TS walk).
717 let body = node.child_by_field_name("body").unwrap_or(node);
718 for i in 0..body.named_child_count() {
719 if let Some(c) = body.named_child(i) {
720 self.visit_node(c);
721 }
722 }
723 // no synthesizeMembers for C#
724 self.stack.pop();
725 }
726
727 fn extract_struct(&mut self, node: Node<'t>) {
728 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
visit_nodeMethod · 0.45

Tested by

no test coverage detected