(&mut self, node: Node<'t>)
| 1124 | } |
| 1125 | |
| 1126 | fn extract_import(&mut self, node: Node<'t>) { |
| 1127 | // Comment-gluing: the header's extent (and thus the signature) can |
| 1128 | // include trailing comment lines — the trimmed FULL text is the |
| 1129 | // signature; the ref stays at the header start. |
| 1130 | let import_text = self.text(node).trim().to_string(); |
| 1131 | let identifier = (0..node.named_child_count()) |
| 1132 | .filter_map(|i| node.named_child(i)) |
| 1133 | .find(|c| c.kind() == "identifier"); |
| 1134 | let Some(identifier) = identifier else { return }; |
| 1135 | let module_name = self.text(identifier).to_string(); |
| 1136 | if module_name.is_empty() { |
| 1137 | return; |
| 1138 | } |
| 1139 | self.create_node( |
| 1140 | "import", |
| 1141 | &module_name, |
| 1142 | node, |
| 1143 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 1144 | ); |
| 1145 | let parent = self.top_row(); |
| 1146 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 1147 | } |
| 1148 | |
| 1149 | /// extractCall — the kotlin paths: navigation member branch (+ the #750 |
| 1150 | /// re-encode) and the raw-text else (paren-then-lambda / glued-invoke |
no test coverage detected