(&mut self, node: Node<'t>)
| 853 | } |
| 854 | |
| 855 | fn extract_import(&mut self, node: Node<'t>) { |
| 856 | let import_text = self.text(node).trim().to_string(); |
| 857 | let scoped = (0..node.named_child_count()) |
| 858 | .filter_map(|i| node.named_child(i)) |
| 859 | .find(|c| c.kind() == "scoped_identifier"); |
| 860 | let Some(scoped) = scoped else { return }; // hook declined |
| 861 | let module_name = self.text(scoped).to_string(); |
| 862 | if module_name.is_empty() { |
| 863 | return; |
| 864 | } |
| 865 | self.create_node( |
| 866 | "import", |
| 867 | &module_name, |
| 868 | node, |
| 869 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 870 | ); |
| 871 | let parent = self.top_row(); |
| 872 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 873 | } |
| 874 | |
| 875 | /// extractCall — the Java method_invocation paths. |
| 876 | fn extract_call(&mut self, node: Node<'t>) { |
no test coverage detected