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

Method extract_static_member_ref

codegraph-kernel/src/kotlin.rs:1334–1370  ·  view source on GitHub ↗

extractStaticMemberRef — navigation_expression value reads, body walker only (assignment WRITES parse as directly_assignable_expression — not a member-access kind — and emit nothing).

(&mut self, node: Node<'t>)

Source from the content-addressed store, hash-verified

1332 /// walker only (assignment WRITES parse as directly_assignable_expression
1333 /// — not a member-access kind — and emit nothing).
1334 fn extract_static_member_ref(&mut self, node: Node<'t>) {
1335 if node.kind() != "navigation_expression" {
1336 return;
1337 }
1338 if self.stack.is_empty() {
1339 return;
1340 }
1341 let owner = self.top_row();
1342 if let Some(parent) = node.parent() {
1343 if parent.kind() == "call_expression" {
1344 let callee = parent
1345 .child_by_field_name("function")
1346 .or_else(|| parent.child_by_field_name("method"))
1347 .or_else(|| parent.named_child(0));
1348 if let Some(callee) = callee {
1349 if callee.start_byte() == node.start_byte() {
1350 return;
1351 }
1352 }
1353 }
1354 }
1355 let recv = node
1356 .child_by_field_name("object")
1357 .or_else(|| node.child_by_field_name("expression"))
1358 .or_else(|| node.child_by_field_name("scope"))
1359 .or_else(|| node.named_child(0));
1360 let Some(recv) = recv else { return };
1361 if matches!(
1362 recv.kind(),
1363 "identifier" | "type_identifier" | "simple_identifier" | "name" | "scoped_type_identifier"
1364 ) {
1365 let text = self.text(recv);
1366 if capitalized_re().is_match(text) {
1367 self.push_ref_at(owner, &text.to_string(), edge_kind_index("references").unwrap(), recv);
1368 }
1369 }
1370 }
1371
1372 /// extractInheritance — delegation_specifier: user_type ?? its
1373 /// constructor_invocation's user_type → ONE `extends` ref named by the

Callers 1

Calls 6

edge_kind_indexFunction · 0.85
capitalized_reFunction · 0.70
textMethod · 0.65
unwrapMethod · 0.60
top_rowMethod · 0.45
push_ref_atMethod · 0.45

Tested by

no test coverage detected