(&mut self, node: Node<'t>)
| 1044 | } |
| 1045 | |
| 1046 | fn extract_import(&mut self, node: Node<'t>) { |
| 1047 | let import_text = self.text(node).trim().to_string(); |
| 1048 | let identifier = (0..node.named_child_count()) |
| 1049 | .filter_map(|i| node.named_child(i)) |
| 1050 | .find(|c| c.kind() == "identifier"); |
| 1051 | let Some(identifier) = identifier else { return }; // hook null → nothing |
| 1052 | let module_name = self.text(identifier).to_string(); |
| 1053 | if module_name.is_empty() { |
| 1054 | return; |
| 1055 | } |
| 1056 | self.create_node( |
| 1057 | "import", |
| 1058 | &module_name, |
| 1059 | node, |
| 1060 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 1061 | ); |
| 1062 | let parent = self.top_row(); |
| 1063 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 1064 | } |
| 1065 | |
| 1066 | /// extractCall — swift rides the generic member branch (navigation) and |
| 1067 | /// the raw-text else; the full matrix is in the checklist. |
no test coverage detected