extractStaticMemberRef — `Type.CONST` value reads (java: field_access).
(&mut self, node: Node<'t>)
| 1008 | |
| 1009 | /// extractStaticMemberRef — `Type.CONST` value reads (java: field_access). |
| 1010 | fn extract_static_member_ref(&mut self, node: Node<'t>) { |
| 1011 | if node.kind() != "field_access" { |
| 1012 | return; |
| 1013 | } |
| 1014 | if self.stack.is_empty() { |
| 1015 | return; |
| 1016 | } |
| 1017 | let owner = self.top_row(); |
| 1018 | // Skip `Type.method()` — the access is a call's callee, already linked. |
| 1019 | if let Some(parent) = node.parent() { |
| 1020 | if parent.kind() == "method_invocation" { |
| 1021 | let callee = parent |
| 1022 | .child_by_field_name("function") |
| 1023 | .or_else(|| parent.child_by_field_name("method")) |
| 1024 | .or_else(|| parent.named_child(0)); |
| 1025 | if let Some(callee) = callee { |
| 1026 | if callee.start_byte() == node.start_byte() { |
| 1027 | return; |
| 1028 | } |
| 1029 | } |
| 1030 | } |
| 1031 | } |
| 1032 | let recv = node |
| 1033 | .child_by_field_name("object") |
| 1034 | .or_else(|| node.child_by_field_name("expression")) |
| 1035 | .or_else(|| node.child_by_field_name("scope")) |
| 1036 | .or_else(|| node.named_child(0)); |
| 1037 | let Some(recv) = recv else { return }; |
| 1038 | if matches!( |
| 1039 | recv.kind(), |
| 1040 | "identifier" | "type_identifier" | "simple_identifier" | "name" | "scoped_type_identifier" |
| 1041 | ) { |
| 1042 | let text = self.text(recv); |
| 1043 | if capitalized_re().is_match(text) { |
| 1044 | self.push_ref_at(owner, &text.to_string(), edge_kind_index("references").unwrap(), recv); |
| 1045 | } |
| 1046 | } |
| 1047 | } |
| 1048 | |
| 1049 | /// extractInheritance — the Java clauses (type_list-aware). |
| 1050 | fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) { |
no test coverage detected