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

Method extract_static_member_ref

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

1071 /// walker only (assignment WRITES parse as directly_assignable_expression
1072 /// — not a member-access kind — and emit nothing).
1073 fn extract_static_member_ref(&mut self, node: Node<'t>) {
1074 if node.kind() != "navigation_expression" {
1075 return;
1076 }
1077 if self.stack.is_empty() {
1078 return;
1079 }
1080 let owner = self.top_row();
1081 if let Some(parent) = node.parent() {
1082 if parent.kind() == "call_expression" {
1083 let callee = parent
1084 .child_by_field_name("function")
1085 .or_else(|| parent.child_by_field_name("method"))
1086 .or_else(|| parent.named_child(0));
1087 if let Some(callee) = callee {
1088 if callee.start_byte() == node.start_byte() {
1089 return;
1090 }
1091 }
1092 }
1093 }
1094 let recv = node
1095 .child_by_field_name("object")
1096 .or_else(|| node.child_by_field_name("expression"))
1097 .or_else(|| node.child_by_field_name("scope"))
1098 .or_else(|| node.named_child(0));
1099 let Some(recv) = recv else { return };
1100 if matches!(
1101 recv.kind(),
1102 "identifier" | "type_identifier" | "simple_identifier" | "name" | "scoped_type_identifier"
1103 ) {
1104 let text = self.text(recv);
1105 if capitalized_re().is_match(text) {
1106 self.push_ref_at(owner, &text.to_string(), edge_kind_index("references").unwrap(), recv);
1107 }
1108 }
1109 }
1110
1111 /// extractInheritance — delegation_specifier: user_type ?? its
1112 /// constructor_invocation's user_type → FIRST type_identifier → ONE

Callers 1

Calls 6

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

Tested by

no test coverage detected