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

Method extract_instantiation

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

Source from the content-addressed store, hash-verified

884 }
885
886 fn extract_instantiation(&mut self, node: Node<'t>) {
887 if self.stack.is_empty() {
888 return;
889 }
890 let ctor = node
891 .child_by_field_name("constructor")
892 .or_else(|| node.child_by_field_name("type"))
893 .or_else(|| node.child_by_field_name("name"))
894 .or_else(|| node.named_child(0));
895 let Some(ctor) = ctor else { return };
896 let class_name = strip_generic_and_qualifier(self.text(ctor));
897 if !class_name.is_empty() {
898 let from = self.top_row();
899 self.push_ref_at(from, &class_name, edge_kind_index("instantiates").unwrap(), node);
900 }
901 }
902
903 /// extractAnonymousClass — `new T() { ... }`.
904 fn extract_anonymous_class(&mut self, node: Node<'t>, body: Node<'t>) {

Callers 2

visit_nodeMethod · 0.45

Calls 6

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

Tested by

no test coverage detected