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

Function unwrapped_text

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

swiftUnwrappedText: a receiver's text from its innermost wrapped operand on — the wrappers sit on the chain's left edge, so `!Settings.Defaults` reads `Settings.Defaults` and `try! Foo.make().bar` reads `Foo.make().bar`.

(node: Node, src: &'s str)

Source from the content-addressed store, hash-verified

163/// on — the wrappers sit on the chain's left edge, so `!Settings.Defaults`
164/// reads `Settings.Defaults` and `try! Foo.make().bar` reads `Foo.make().bar`.
165fn unwrapped_text<'s>(node: Node, src: &'s str) -> &'s str {
166 let mut start = node.start_byte();
167 let mut cur = Some(node);
168 while let Some(n) = cur {
169 if is_call_wrapper(n, src) {
170 cur = wrapped_operand(n);
171 if let Some(inner) = cur {
172 start = inner.start_byte();
173 }
174 } else if matches!(n.kind(), "navigation_expression" | "call_expression") {
175 cur = n.named_child(0);
176 } else {
177 break;
178 }
179 }
180 &src[start..node.end_byte()]
181}
182
183struct Scope {
184 row: u32,

Callers 1

extract_callMethod · 0.85

Calls 2

is_call_wrapperFunction · 0.85
wrapped_operandFunction · 0.85

Tested by

no test coverage detected