(&mut self, node: Node<'t>)
| 1189 | } |
| 1190 | |
| 1191 | fn extract_import(&mut self, node: Node<'t>) { |
| 1192 | // Comment-gluing: the header's extent (and thus the signature) can |
| 1193 | // include trailing comment lines — the trimmed FULL text is the |
| 1194 | // signature; the ref stays at the header start. |
| 1195 | let import_text = self.text(node).trim().to_string(); |
| 1196 | let identifier = (0..node.named_child_count()) |
| 1197 | .filter_map(|i| node.named_child(i)) |
| 1198 | .find(|c| c.kind() == "identifier"); |
| 1199 | let Some(identifier) = identifier else { return }; |
| 1200 | let module_name = self.text(identifier).to_string(); |
| 1201 | if module_name.is_empty() { |
| 1202 | return; |
| 1203 | } |
| 1204 | self.create_node( |
| 1205 | "import", |
| 1206 | &module_name, |
| 1207 | node, |
| 1208 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 1209 | ); |
| 1210 | let parent = self.top_row(); |
| 1211 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 1212 | } |
| 1213 | |
| 1214 | /// extractCall — the kotlin paths: navigation member branch (+ the #750 |
| 1215 | /// re-encode) and the raw-text else (paren-then-lambda / glued-invoke |
no test coverage detected