extractInheritance — the rust-reachable cases: trait_bounds (supertraits; a scoped `fmt::Debug` bound matches NO case and is dropped) and the field_declaration_list recursion. The TS Go-embedding check on field_declaration is gated to Go (and was inert here anyway — every rust field has a field_identifier).
(&mut self, node: Node<'t>, class_row: u32)
| 1122 | /// check on field_declaration is gated to Go (and was inert here anyway — |
| 1123 | /// every rust field has a field_identifier). |
| 1124 | fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) { |
| 1125 | stack_guard!(); |
| 1126 | let extends_kind = edge_kind_index("extends").unwrap(); |
| 1127 | for i in 0..node.named_child_count() { |
| 1128 | let Some(child) = node.named_child(i) else { continue }; |
| 1129 | match child.kind() { |
| 1130 | "trait_bounds" => { |
| 1131 | for j in 0..child.named_child_count() { |
| 1132 | let Some(bound) = child.named_child(j) else { continue }; |
| 1133 | let type_node: Option<Node> = match bound.kind() { |
| 1134 | "type_identifier" => Some(bound), |
| 1135 | "generic_type" => (0..bound.named_child_count()) |
| 1136 | .filter_map(|k| bound.named_child(k)) |
| 1137 | .find(|c| c.kind() == "type_identifier"), |
| 1138 | "higher_ranked_trait_bound" => { |
| 1139 | let generic = (0..bound.named_child_count()) |
| 1140 | .filter_map(|k| bound.named_child(k)) |
| 1141 | .find(|c| c.kind() == "generic_type"); |
| 1142 | generic |
| 1143 | .and_then(|g| { |
| 1144 | (0..g.named_child_count()) |
| 1145 | .filter_map(|k| g.named_child(k)) |
| 1146 | .find(|c| c.kind() == "type_identifier") |
| 1147 | }) |
| 1148 | .or_else(|| { |
| 1149 | (0..bound.named_child_count()) |
| 1150 | .filter_map(|k| bound.named_child(k)) |
| 1151 | .find(|c| c.kind() == "type_identifier") |
| 1152 | }) |
| 1153 | } |
| 1154 | _ => None, // scoped_type_identifier: dropped (quirk) |
| 1155 | }; |
| 1156 | if let Some(tn) = type_node { |
| 1157 | let name = self.text(tn).to_string(); |
| 1158 | self.push_ref_at(class_row, &name, extends_kind, tn); |
| 1159 | } |
| 1160 | } |
| 1161 | } |
| 1162 | "field_declaration_list" | "class_heritage" => { |
| 1163 | self.extract_inheritance(child, class_row); |
| 1164 | } |
| 1165 | _ => {} |
| 1166 | } |
| 1167 | } |
| 1168 | } |
| 1169 | |
| 1170 | /// extractRustImplItem — `impl Trait for Type` back-reference from the |
| 1171 | /// grammar's `trait` / `type` fields (#1588; an inherent impl has no |
no test coverage detected