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

Method extract_static_member_ref

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

1283 /// walker only (assignment WRITES parse as directly_assignable_expression
1284 /// — not a member-access kind — and emit nothing).
1285 fn extract_static_member_ref(&mut self, node: Node<'t>) {
1286 if node.kind() != "navigation_expression" {
1287 return;
1288 }
1289 if self.stack.is_empty() {
1290 return;
1291 }
1292 let owner = self.top_row();
1293 if let Some(parent) = node.parent() {
1294 if parent.kind() == "call_expression" {
1295 let callee = parent
1296 .child_by_field_name("function")
1297 .or_else(|| parent.child_by_field_name("method"))
1298 .or_else(|| parent.named_child(0));
1299 if let Some(callee) = callee {
1300 if callee.start_byte() == node.start_byte() {
1301 return;
1302 }
1303 }
1304 }
1305 }
1306 let recv = node
1307 .child_by_field_name("object")
1308 .or_else(|| node.child_by_field_name("expression"))
1309 .or_else(|| node.child_by_field_name("scope"))
1310 .or_else(|| node.named_child(0));
1311 let Some(recv) = recv else { return };
1312 if matches!(
1313 recv.kind(),
1314 "identifier" | "type_identifier" | "simple_identifier" | "name" | "scoped_type_identifier"
1315 ) {
1316 let text = self.text(recv);
1317 if capitalized_re().is_match(text) {
1318 self.push_ref_at(owner, &text.to_string(), edge_kind_index("references").unwrap(), recv);
1319 }
1320 }
1321 }
1322
1323 /// extractInheritance — delegation_specifier: user_type ?? its
1324 /// 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