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

Method extract_static_member_ref

codegraph-kernel/src/kotlin.rs:1335–1371  ·  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

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