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

Function unwrapped_text

codegraph-kernel/src/swift.rs:164–180  ·  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

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