(&mut self, n: Node<'t>, decorated_row: u32)
| 1209 | } |
| 1210 | |
| 1211 | fn consider_decorator(&mut self, n: Node<'t>, decorated_row: u32) { |
| 1212 | if !matches!(n.kind(), "decorator" | "annotation" | "marker_annotation" | "attribute") { |
| 1213 | return; |
| 1214 | } |
| 1215 | let mut target: Option<Node> = None; |
| 1216 | for i in 0..n.named_child_count() { |
| 1217 | let Some(child) = n.named_child(i) else { continue }; |
| 1218 | if child.kind() == "call_expression" { |
| 1219 | target = child.child_by_field_name("function").or_else(|| child.named_child(0)); |
| 1220 | if target.is_some() { |
| 1221 | break; |
| 1222 | } |
| 1223 | } |
| 1224 | if matches!( |
| 1225 | child.kind(), |
| 1226 | "identifier" | "member_expression" | "scoped_identifier" | "navigation_expression" |
| 1227 | | "user_type" | "type_identifier" |
| 1228 | ) { |
| 1229 | target = Some(child); |
| 1230 | break; |
| 1231 | } |
| 1232 | } |
| 1233 | let Some(target) = target else { return }; |
| 1234 | let name = strip_generic_and_qualifier(self.text(target)); |
| 1235 | if name.is_empty() { |
| 1236 | return; |
| 1237 | } |
| 1238 | self.push_ref_at(decorated_row, &name, edge_kind_index("decorates").unwrap(), n); |
| 1239 | } |
| 1240 | |
| 1241 | // --- function-as-value refs (SWIFT_SPEC, function-ref.ts:288) ------------------- |
| 1242 |
no test coverage detected