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)
| 1140 | /// check on field_declaration is gated to Go (and was inert here anyway — |
| 1141 | /// every rust field has a field_identifier). |
| 1142 | fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) { |
| 1143 | stack_guard!(); |
| 1144 | let extends_kind = edge_kind_index("extends").unwrap(); |
| 1145 | for i in 0..node.named_child_count() { |
| 1146 | let Some(child) = node.named_child(i) else { continue }; |
| 1147 | match child.kind() { |
| 1148 | "trait_bounds" => { |
| 1149 | for j in 0..child.named_child_count() { |
| 1150 | let Some(bound) = child.named_child(j) else { continue }; |
| 1151 | let type_node: Option<Node> = match bound.kind() { |
| 1152 | "type_identifier" => Some(bound), |
| 1153 | "generic_type" => (0..bound.named_child_count()) |
| 1154 | .filter_map(|k| bound.named_child(k)) |
| 1155 | .find(|c| c.kind() == "type_identifier"), |
| 1156 | "higher_ranked_trait_bound" => { |
| 1157 | let generic = (0..bound.named_child_count()) |
| 1158 | .filter_map(|k| bound.named_child(k)) |
| 1159 | .find(|c| c.kind() == "generic_type"); |
| 1160 | generic |
| 1161 | .and_then(|g| { |
| 1162 | (0..g.named_child_count()) |
| 1163 | .filter_map(|k| g.named_child(k)) |
| 1164 | .find(|c| c.kind() == "type_identifier") |
| 1165 | }) |
| 1166 | .or_else(|| { |
| 1167 | (0..bound.named_child_count()) |
| 1168 | .filter_map(|k| bound.named_child(k)) |
| 1169 | .find(|c| c.kind() == "type_identifier") |
| 1170 | }) |
| 1171 | } |
| 1172 | _ => None, // scoped_type_identifier: dropped (quirk) |
| 1173 | }; |
| 1174 | if let Some(tn) = type_node { |
| 1175 | let name = self.text(tn).to_string(); |
| 1176 | self.push_ref_at(class_row, &name, extends_kind, tn); |
| 1177 | } |
| 1178 | } |
| 1179 | } |
| 1180 | "field_declaration_list" | "class_heritage" => { |
| 1181 | self.extract_inheritance(child, class_row); |
| 1182 | } |
| 1183 | _ => {} |
| 1184 | } |
| 1185 | } |
| 1186 | } |
| 1187 | |
| 1188 | /// extractRustImplItem — `impl Trait for Type` back-reference from the |
| 1189 | /// grammar's `trait` / `type` fields (#1588; an inherent impl has no |
no test coverage detected