mirror of
https://github.com/colbymchenry/codegraph.git
synced 2026-10-20 16:05:00 +08:00
3308cff071
tree-sitter-swift binds a prefix operator to the leftmost operand: `!isReady()` parses as `(!isReady)()`, and `!store.contains(id)` as `(!store).contains(id)`. `try` and `await` before a chain bind to the part before its last call: `try! Decoder().decode(d)` parses as `(try! Decoder()).decode(d)`. Both engines read the callee or receiver node as written, so the call was named `!isReady`, which never resolves, or it lost its receiver and name-matched whichever `contains` or `decode` came first; a type path behind a `!` lost its path too. Both walkers now strip these wrappers (a prefix operator other than an implicit member's `.`, `try` and `await`) off a call's callee and receiver. They read a receiver chain's text from its innermost wrapped operand on, for the chained-call encoding and the type-path receiver, and look through a prefix operator for the type a member read references: `!Config.shared.isOn` references `Config`. An operator applied to a parenthesized value, `!(x)` or `-(a + b)`, parses as a call of the operator and now emits no call. swift-wrapped-call-receivers.test.ts checks the edges, and TortureWrappedCalls.swift pins both engines' refs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>