(&mut self, n: Node<'t>, decorated_row: u32)
| 1055 | } |
| 1056 | |
| 1057 | fn consider_decorator(&mut self, n: Node<'t>, decorated_row: u32) { |
| 1058 | if !matches!(n.kind(), "decorator" | "annotation" | "marker_annotation" | "attribute") { |
| 1059 | return; |
| 1060 | } |
| 1061 | let mut target: Option<Node> = None; |
| 1062 | for i in 0..n.named_child_count() { |
| 1063 | let Some(child) = n.named_child(i) else { continue }; |
| 1064 | if child.kind() == "call_expression" { |
| 1065 | target = child.child_by_field_name("function").or_else(|| child.named_child(0)); |
| 1066 | if target.is_some() { |
| 1067 | break; |
| 1068 | } |
| 1069 | } |
| 1070 | if matches!( |
| 1071 | child.kind(), |
| 1072 | "identifier" | "member_expression" | "scoped_identifier" | "navigation_expression" |
| 1073 | | "user_type" | "type_identifier" |
| 1074 | ) { |
| 1075 | target = Some(child); |
| 1076 | break; |
| 1077 | } |
| 1078 | } |
| 1079 | let Some(target) = target else { return }; |
| 1080 | let name = strip_generic_and_qualifier(self.text(target)); |
| 1081 | if name.is_empty() { |
| 1082 | return; |
| 1083 | } |
| 1084 | self.push_ref_at(decorated_row, &name, edge_kind_index("decorates").unwrap(), n); |
| 1085 | } |
| 1086 | |
| 1087 | /// extractTypeAnnotations — Java's returnField is `type`. |
| 1088 | fn extract_type_annotations(&mut self, node: Node<'t>, from_row: u32) { |
no test coverage detected