(&mut self, node: Node<'t>)
| 972 | } |
| 973 | |
| 974 | fn extract_import(&mut self, node: Node<'t>) { |
| 975 | let import_text = self.text(node).trim().to_string(); |
| 976 | let identifier = (0..node.named_child_count()) |
| 977 | .filter_map(|i| node.named_child(i)) |
| 978 | .find(|c| c.kind() == "identifier"); |
| 979 | let Some(identifier) = identifier else { return }; // hook null → nothing |
| 980 | let module_name = self.text(identifier).to_string(); |
| 981 | if module_name.is_empty() { |
| 982 | return; |
| 983 | } |
| 984 | self.create_node( |
| 985 | "import", |
| 986 | &module_name, |
| 987 | node, |
| 988 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 989 | ); |
| 990 | let parent = self.top_row(); |
| 991 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 992 | } |
| 993 | |
| 994 | /// extractCall — swift rides the generic member branch (navigation) and |
| 995 | /// the raw-text else; the full matrix is in the checklist. |
no test coverage detected