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