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

Method extract_static_member_ref

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

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

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