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

Method swift_property_info

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

swiftPropertyInfo (tree-sitter.ts:277).

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

Source from the content-addressed store, hash-verified

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

Callers 2

extract_variableMethod · 0.80

Calls 2

first_simple_identifierFunction · 0.85
textMethod · 0.65

Tested by

no test coverage detected