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

Method extract_class

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

Source from the content-addressed store, hash-verified

1025 }
1026
1027 fn extract_class(&mut self, node: Node<'t>) {
1028 stack_guard!();
1029 let resolved_body = self.resolve_body(node);
1030 let name = self.extract_name(node);
1031 let extra = Extra {
1032 docstring: preceding_docstring(node, self.src),
1033 visibility: Some(self.visibility_of(node)),
1034 ..Extra::default()
1035 };
1036 let Some(row) = self.create_node("class", &name, node, extra) else { return };
1037 self.extract_inheritance(node, row);
1038 // primaryCtor refs: csharp-gated no-op.
1039 self.extract_decorators_for(node, row);
1040 self.stack.push(Scope { row, kind: "class", name });
1041 // Bodied: ONLY class_body children (primary-ctor properties/defaults
1042 // invisible). Bodiless: the class node itself → header children
1043 // visited → ctor default-value + super-arg calls attribute to the
1044 // CLASS (the asymmetry, pinned).
1045 let body = resolved_body.unwrap_or(node);
1046 for i in 0..body.named_child_count() {
1047 if let Some(c) = body.named_child(i) {
1048 self.visit_node(c);
1049 }
1050 }
1051 self.stack.pop();
1052 }
1053
1054 fn extract_interface(&mut self, node: Node<'t>) {
1055 stack_guard!();

Callers 2

visit_nodeMethod · 0.45

Calls 9

preceding_docstringFunction · 0.85
pushMethod · 0.80
resolve_bodyMethod · 0.45
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