(&mut self, node: Node<'t>)
| 795 | } |
| 796 | |
| 797 | fn extract_import(&mut self, node: Node<'t>) { |
| 798 | let import_text = self.text(node).trim().to_string(); |
| 799 | let scoped = (0..node.named_child_count()) |
| 800 | .filter_map(|i| node.named_child(i)) |
| 801 | .find(|c| c.kind() == "scoped_identifier"); |
| 802 | let Some(scoped) = scoped else { return }; // hook declined |
| 803 | let module_name = self.text(scoped).to_string(); |
| 804 | if module_name.is_empty() { |
| 805 | return; |
| 806 | } |
| 807 | self.create_node( |
| 808 | "import", |
| 809 | &module_name, |
| 810 | node, |
| 811 | Extra { signature: Some(import_text), ..Extra::default() }, |
| 812 | ); |
| 813 | let parent = self.top_row(); |
| 814 | self.push_ref_at(parent, &module_name.clone(), edge_kind_index("imports").unwrap(), node); |
| 815 | } |
| 816 | |
| 817 | /// extractCall — the Java method_invocation paths. |
| 818 | fn extract_call(&mut self, node: Node<'t>) { |
no test coverage detected