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

Method extract_inheritance

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

Source from the content-addressed store, hash-verified

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

Callers 2

extract_classMethod · 0.45
extract_enumMethod · 0.45

Calls 3

scala_base_type_nameMethod · 0.80
collectMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected