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

Method extract_instantiation

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

Source from the content-addressed store, hash-verified

921 }
922
923 fn extract_instantiation(&mut self, node: Node<'t>) {
924 if self.stack.is_empty() {
925 return;
926 }
927 let ctor = node
928 .child_by_field_name("constructor")
929 .or_else(|| node.child_by_field_name("type"))
930 .or_else(|| node.child_by_field_name("name"))
931 .or_else(|| node.named_child(0));
932 let Some(ctor) = ctor else { return };
933 let class_name = strip_generic_and_qualifier(self.text(ctor));
934 if !class_name.is_empty() {
935 let from = self.top_row();
936 self.push_ref_at(from, &class_name, edge_kind_index("instantiates").unwrap(), node);
937 }
938 }
939
940 /// extractAnonymousClass — `new T() { ... }`.
941 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
textMethod · 0.65
unwrapMethod · 0.60
top_rowMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected