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