MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / extract_import

Method extract_import

codegraph-kernel/src/java.rs:805–823  ·  view source on GitHub ↗
(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

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

Callers 1

visit_nodeMethod · 0.45

Calls 6

edge_kind_indexFunction · 0.85
textMethod · 0.65
unwrapMethod · 0.60
create_nodeMethod · 0.45
top_rowMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected