(&mut self, node: Node<'t>)
| 1230 | } |
| 1231 | |
| 1232 | fn extract_import(&mut self, node: Node<'t>) { |
| 1233 | // Comment-gluing: the header's extent (and thus the signature) can |
| 1234 | // include trailing comment lines — the trimmed FULL text is the |
| 1235 | // signature; the ref stays at the header start. |
| 1236 | let import_text = self.text(node).trim().to_string(); |
| 1237 | let identifier = (0..node.named_child_count()) |
| 1238 | .filter_map(|i| node.named_child(i)) |
| 1239 | .find(|c| c.kind() == "identifier"); |
| 1240 | let Some(identifier) = identifier else { return }; |
| 1241 | let module_name = self.text(identifier).to_string(); |
| 1242 | if module_name.is_empty() { |
| 1243 | return; |
| 1244 | } |
| 1245 | self.create_node( |
| 1246 | "import", |
| 1247 | &module_name, |
| 1248 | node, |
| 1249 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 1250 | ); |
| 1251 | let parent = self.top_row(); |
| 1252 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 1253 | } |
| 1254 | |
| 1255 | /// extractCall — the kotlin paths: navigation member branch (+ the #750 |
| 1256 | /// re-encode) and the raw-text else (paren-then-lambda / glued-invoke |
no test coverage detected