mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Expand editor placeholder to trailing closures inside a TryExpr
rdar://108391690
This commit is contained in:
@@ -1658,7 +1658,14 @@ private:
|
||||
auto SR = E->getSourceRange();
|
||||
if (SR.isValid() && SM.rangeContainsTokenLoc(SR, TargetLoc) &&
|
||||
!checkCallExpr(E) && !EnclosingCallAndArg.first) {
|
||||
OuterExpr = E;
|
||||
if (!isa<TryExpr>(E) && !isa<AwaitExpr>(E) &&
|
||||
!isa<PrefixUnaryExpr>(E)) {
|
||||
// We don't want to expand to trailing closures if the call is
|
||||
// nested inside another expression that has closing characters,
|
||||
// like a `)` for a function call. This is not the case for
|
||||
// `try`, `await` and prefix operator applications.
|
||||
OuterExpr = E;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user