MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / swift_property_info

Method swift_property_info

codegraph-kernel/src/swift.rs:615–631  ·  view source on GitHub ↗

swiftPropertyInfo (tree-sitter.ts:277).

(&self, node: Node<'t>)

Source from the content-addressed store, hash-verified

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

Callers 2

extract_variableMethod · 0.80

Calls 3

first_simple_identifierFunction · 0.85
mapMethod · 0.80
textMethod · 0.65

Tested by

no test coverage detected