swiftPropertyInfo (tree-sitter.ts:277).
(&self, node: Node<'t>)
| 540 | |
| 541 | /// swiftPropertyInfo (tree-sitter.ts:277). |
| 542 | fn swift_property_info(&self, node: Node<'t>) -> SwiftPropInfo<'t> { |
| 543 | let pattern = node.child_by_field_name("name").or_else(|| { |
| 544 | (0..node.named_child_count()) |
| 545 | .filter_map(|i| node.named_child(i)) |
| 546 | .find(|c| matches!(c.kind(), "value_binding_pattern" | "pattern")) |
| 547 | }); |
| 548 | let binding = (0..node.named_child_count()) |
| 549 | .filter_map(|i| node.named_child(i)) |
| 550 | .find(|c| c.kind() == "value_binding_pattern"); |
| 551 | let is_let = binding |
| 552 | .map(|b| self.text(b).trim_start().starts_with("let")) |
| 553 | .unwrap_or(false); |
| 554 | let is_computed = (0..node.named_child_count()) |
| 555 | .filter_map(|i| node.named_child(i)) |
| 556 | .any(|c| matches!(c.kind(), "computed_property" | "protocol_property_requirements")); |
| 557 | SwiftPropInfo { name_node: first_simple_identifier(pattern), is_let, is_computed } |
| 558 | } |
| 559 | |
| 560 | // --- the dispatcher (visitNode, Swift-relevant branches) ----------------------- |
| 561 |
no test coverage detected