(&mut self, n: Node<'t>, decorated_row: u32)
| 1141 | } |
| 1142 | |
| 1143 | fn consider_decorator(&mut self, n: Node<'t>, decorated_row: u32) { |
| 1144 | if !matches!(n.kind(), "decorator" | "annotation" | "marker_annotation" | "attribute") { |
| 1145 | return; |
| 1146 | } |
| 1147 | let mut target: Option<Node> = None; |
| 1148 | for i in 0..n.named_child_count() { |
| 1149 | let Some(child) = n.named_child(i) else { continue }; |
| 1150 | if child.kind() == "call_expression" { |
| 1151 | target = child.child_by_field_name("function").or_else(|| child.named_child(0)); |
| 1152 | if target.is_some() { |
| 1153 | break; |
| 1154 | } |
| 1155 | } |
| 1156 | if matches!( |
| 1157 | child.kind(), |
| 1158 | "identifier" | "member_expression" | "scoped_identifier" | "navigation_expression" |
| 1159 | | "user_type" | "type_identifier" |
| 1160 | ) { |
| 1161 | target = Some(child); |
| 1162 | break; |
| 1163 | } |
| 1164 | } |
| 1165 | let Some(target) = target else { return }; |
| 1166 | let name = strip_generic_and_qualifier(self.text(target)); |
| 1167 | if name.is_empty() { |
| 1168 | return; |
| 1169 | } |
| 1170 | self.push_ref_at(decorated_row, &name, edge_kind_index("decorates").unwrap(), n); |
| 1171 | } |
| 1172 | |
| 1173 | /// extractTypeAnnotations — Java's returnField is `type`. |
| 1174 | fn extract_type_annotations(&mut self, node: Node<'t>, from_row: u32) { |
no test coverage detected