extractStaticMemberRef — `Type.CONST` value reads (java: field_access).
(&mut self, node: Node<'t>)
| 985 | |
| 986 | /// extractStaticMemberRef — `Type.CONST` value reads (java: field_access). |
| 987 | fn extract_static_member_ref(&mut self, node: Node<'t>) { |
| 988 | if node.kind() != "field_access" { |
| 989 | return; |
| 990 | } |
| 991 | if self.stack.is_empty() { |
| 992 | return; |
| 993 | } |
| 994 | let owner = self.top_row(); |
| 995 | // Skip `Type.method()` — the access is a call's callee, already linked. |
| 996 | if let Some(parent) = node.parent() { |
| 997 | if parent.kind() == "method_invocation" { |
| 998 | let callee = parent |
| 999 | .child_by_field_name("function") |
| 1000 | .or_else(|| parent.child_by_field_name("method")) |
| 1001 | .or_else(|| parent.named_child(0)); |
| 1002 | if let Some(callee) = callee { |
| 1003 | if callee.start_byte() == node.start_byte() { |
| 1004 | return; |
| 1005 | } |
| 1006 | } |
| 1007 | } |
| 1008 | } |
| 1009 | let recv = node |
| 1010 | .child_by_field_name("object") |
| 1011 | .or_else(|| node.child_by_field_name("expression")) |
| 1012 | .or_else(|| node.child_by_field_name("scope")) |
| 1013 | .or_else(|| node.named_child(0)); |
| 1014 | let Some(recv) = recv else { return }; |
| 1015 | if matches!( |
| 1016 | recv.kind(), |
| 1017 | "identifier" | "type_identifier" | "simple_identifier" | "name" | "scoped_type_identifier" |
| 1018 | ) { |
| 1019 | let text = self.text(recv); |
| 1020 | if capitalized_re().is_match(text) { |
| 1021 | self.push_ref_at(owner, &text.to_string(), edge_kind_index("references").unwrap(), recv); |
| 1022 | } |
| 1023 | } |
| 1024 | } |
| 1025 | |
| 1026 | /// extractInheritance — the Java clauses (type_list-aware). |
| 1027 | fn extract_inheritance(&mut self, node: Node<'t>, class_row: u32) { |
no test coverage detected