swiftPropertyInfo (tree-sitter.ts:277).
(&self, node: Node<'t>)
| 612 | |
| 613 | /// swiftPropertyInfo (tree-sitter.ts:277). |
| 614 | fn swift_property_info(&self, node: Node<'t>) -> SwiftPropInfo<'t> { |
| 615 | let pattern = node.child_by_field_name("name").or_else(|| { |
| 616 | (0..node.named_child_count()) |
| 617 | .filter_map(|i| node.named_child(i)) |
| 618 | .find(|c| matches!(c.kind(), "value_binding_pattern" | "pattern")) |
| 619 | }); |
| 620 | let binding = (0..node.named_child_count()) |
| 621 | .filter_map(|i| node.named_child(i)) |
| 622 | .find(|c| c.kind() == "value_binding_pattern"); |
| 623 | let is_let = binding |
| 624 | .map(|b| self.text(b).trim_start().starts_with("let")) |
| 625 | .unwrap_or(false); |
| 626 | let is_computed = (0..node.named_child_count()) |
| 627 | .filter_map(|i| node.named_child(i)) |
| 628 | .any(|c| matches!(c.kind(), "computed_property" | "protocol_property_requirements")); |
| 629 | SwiftPropInfo { name_node: first_simple_identifier(pattern), is_let, is_computed } |
| 630 | } |
| 631 | |
| 632 | // --- the dispatcher (visitNode, Swift-relevant branches) ----------------------- |
| 633 |
no test coverage detected