(&mut self, n: Node<'t>, decorated_row: u32)
| 1553 | } |
| 1554 | |
| 1555 | fn consider_decorator(&mut self, n: Node<'t>, decorated_row: u32) { |
| 1556 | if !matches!(n.kind(), "decorator" | "annotation" | "marker_annotation" | "attribute") { |
| 1557 | return; |
| 1558 | } |
| 1559 | let mut target: Option<Node> = None; |
| 1560 | for i in 0..n.named_child_count() { |
| 1561 | let Some(child) = n.named_child(i) else { continue }; |
| 1562 | if child.kind() == "call_expression" { |
| 1563 | target = child.child_by_field_name("function").or_else(|| child.named_child(0)); |
| 1564 | if target.is_some() { |
| 1565 | break; |
| 1566 | } |
| 1567 | } |
| 1568 | if matches!( |
| 1569 | child.kind(), |
| 1570 | "identifier" | "member_expression" | "scoped_identifier" | "navigation_expression" |
| 1571 | | "user_type" | "type_identifier" |
| 1572 | ) { |
| 1573 | target = Some(child); |
| 1574 | break; |
| 1575 | } |
| 1576 | } |
| 1577 | let Some(target) = target else { return }; |
| 1578 | let name = strip_generic_and_qualifier(self.text(target)); |
| 1579 | if name.is_empty() { |
| 1580 | return; |
| 1581 | } |
| 1582 | self.push_ref_at(decorated_row, &name, edge_kind_index("decorates").unwrap(), n); |
| 1583 | } |
| 1584 | |
| 1585 | // --- function-as-value refs (KOTLIN_SPEC, function-ref.ts:240) ------------------ |
| 1586 |
no test coverage detected