extractStaticMemberRef — `Type.CONST` value reads (java: field_access).
(&mut self, node: Node<'t>)
| 936 | |
| 937 | /// extractStaticMemberRef — `Type.CONST` value reads (java: field_access). |
| 938 | fn extract_static_member_ref(&mut self, node: Node<'t>) { |
| 939 | if node.kind() != "field_access" { |
| 940 | return; |
| 941 | } |
| 942 | if self.stack.is_empty() { |
| 943 | return; |
| 944 | } |
| 945 | let owner = self.top_row(); |
| 946 | // Skip `Type.method()` — the access is a call's callee, already linked. |
| 947 | if let Some(parent) = node.parent() { |
| 948 | if parent.kind() == "method_invocation" { |
| 949 | let callee = parent |
| 950 | .child_by_field_name("function") |
| 951 | .or_else(|| parent.child_by_field_name("method")) |
| 952 | .or_else(|| parent.named_child(0)); |
| 953 | if let Some(callee) = callee { |
| 954 | if callee.start_byte() == node.start_byte() { |
| 955 | return; |
| 956 | } |
| 957 | } |
| 958 | } |
| 959 | } |
| 960 | let recv = node |
| 961 | .child_by_field_name("object") |
| 962 | .or_else(|| node.child_by_field_name("expression")) |
| 963 | .or_else(|| node.child_by_field_name("scope")) |
| 964 | .or_else(|| node.named_child(0)); |
| 965 | let Some(recv) = recv else { return }; |
| 966 | if matches!( |
| 967 | recv.kind(), |
| 968 | "identifier" | "type_identifier" | "simple_identifier" | "name" | "scoped_type_identifier" |
| 969 | ) { |
| 970 | let text = self.text(recv); |
| 971 | if capitalized_re().is_match(text) { |
| 972 | self.push_ref_at(owner, &text.to_string(), edge_kind_index("references").unwrap(), recv); |
| 973 | } |
| 974 | } |
| 975 | } |
| 976 | |
| 977 | /// extractInheritance — the Java clauses (type_list-aware). |
| 978 | fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) { |
no test coverage detected