(&mut self, node: Node<'t>)
| 957 | } |
| 958 | |
| 959 | fn extract_import(&mut self, node: Node<'t>) { |
| 960 | // Comment-gluing: the header's extent (and thus the signature) can |
| 961 | // include trailing comment lines — the trimmed FULL text is the |
| 962 | // signature; the ref stays at the header start. |
| 963 | let import_text = self.text(node).trim().to_string(); |
| 964 | let identifier = (0..node.named_child_count()) |
| 965 | .filter_map(|i| node.named_child(i)) |
| 966 | .find(|c| c.kind() == "identifier"); |
| 967 | let Some(identifier) = identifier else { return }; |
| 968 | let module_name = self.text(identifier).to_string(); |
| 969 | if module_name.is_empty() { |
| 970 | return; |
| 971 | } |
| 972 | self.create_node( |
| 973 | "import", |
| 974 | &module_name, |
| 975 | node, |
| 976 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 977 | ); |
| 978 | let parent = self.top_row(); |
| 979 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 980 | } |
| 981 | |
| 982 | /// extractCall — the kotlin paths: navigation member branch (+ the #750 |
| 983 | /// re-encode) and the raw-text else (paren-then-lambda / glued-invoke |
no test coverage detected