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

Method extract_inheritance

codegraph-kernel/src/scala.rs:1103–1123  ·  view source on GitHub ↗
(&mut self, node: Node<'t>, class_row: u32)

Source from the content-addressed store, hash-verified

1101 // --- extractInheritance — the scala branch (:5339-5360) ---------------
1102
1103 fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) {
1104 let mut cursor = node.walk();
1105 let kids: Vec<Node<'t>> = node.named_children(&mut cursor).collect();
1106 for child in kids {
1107 if matches!(
1108 child.kind(),
1109 "extends_clause" | "superclass" | "base_clause" | "extends_interfaces"
1110 ) {
1111 // Iterate ALL supertypes (with-chains, comma form); unwrap
1112 // each via scalaBaseTypeName; `arguments` children → None →
1113 // skipped. `derives_clause` is a different kind — silent.
1114 let mut cc = child.walk();
1115 let targets: Vec<Node<'t>> = child.named_children(&mut cc).collect();
1116 for target in targets {
1117 if let Some(name) = self.scala_base_type_name(Some(target)) {
1118 self.push_ref_at(class_row, &name, "extends", target);
1119 }
1120 }
1121 }
1122 }
1123 }
1124
1125 // --- extractTypeAnnotations (:5788-5880) ------------------------------
1126

Callers 2

extract_classMethod · 0.45
extract_enumMethod · 0.45

Calls 4

scala_base_type_nameMethod · 0.80
walkMethod · 0.45
collectMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected