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

Function is_call_wrapper

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

isSwiftCallWrapper (tree-sitter.ts): a wrapper that leaves a call's target the same — `try`/`await`/`unsafe`, which before a chain bind to the part before its last call (`try! A().b()` is `(try! A()).b()`), or a prefix operator, which binds to the leftmost operand (`!isReady()` is `(!isReady)()`). An implicit member's leading `.` (`.success(x)`) is part of the name.

(node: Node, src: &str)

Source from the content-addressed store, hash-verified

135/// `(!isReady)()`). An implicit member's leading `.` (`.success(x)`) is part
136/// of the name.
137fn is_call_wrapper(node: Node, src: &str) -> bool {
138 match node.kind() {
139 "try_expression" | "await_expression" | "unsafe_expression" => true,
140 "prefix_expression" => !src[node.byte_range()].starts_with('.'),
141 _ => false,
142 }
143}
144
145/// swiftWrappedOperand: the operand a call wrapper wraps.
146fn wrapped_operand<'t>(node: Node<'t>) -> Option<Node<'t>> {

Callers 2

peel_call_wrappersFunction · 0.85
unwrapped_textFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected