(&mut self, node: Node<'t>)
| 832 | } |
| 833 | |
| 834 | fn extract_import(&mut self, node: Node<'t>) { |
| 835 | let import_text = self.text(node).trim().to_string(); |
| 836 | let scoped = (0..node.named_child_count()) |
| 837 | .filter_map(|i| node.named_child(i)) |
| 838 | .find(|c| c.kind() == "scoped_identifier"); |
| 839 | let Some(scoped) = scoped else { return }; // hook declined |
| 840 | let module_name = self.text(scoped).to_string(); |
| 841 | if module_name.is_empty() { |
| 842 | return; |
| 843 | } |
| 844 | self.create_node( |
| 845 | "import", |
| 846 | &module_name, |
| 847 | node, |
| 848 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 849 | ); |
| 850 | let parent = self.top_row(); |
| 851 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 852 | } |
| 853 | |
| 854 | /// extractCall — the Java method_invocation paths. |
| 855 | fn extract_call(&mut self, node: Node<'t>) { |
no test coverage detected