@@ -27,12 +27,8 @@ CompletionContextFinder::CompletionContextFinder(
27
27
28
28
ASTWalker::PreWalkResult<Expr *>
29
29
CompletionContextFinder::walkToExprPre (Expr *E) {
30
- if (auto *closure = dyn_cast<ClosureExpr>(E)) {
31
- Contexts.push_back ({closure->hasSingleExpressionBody ()
32
- ? ContextKind::SingleStmtClosure
33
- : ContextKind::MultiStmtClosure,
34
- closure});
35
- }
30
+ if (auto *closure = dyn_cast<ClosureExpr>(E))
31
+ Contexts.push_back ({ContextKind::Closure, closure});
36
32
37
33
if (isa<InterpolatedStringLiteralExpr>(E)) {
38
34
Contexts.push_back ({ContextKind::StringInterpolation, E});
@@ -120,15 +116,12 @@ CompletionContextFinder::getFallbackCompletionExpr() const {
120
116
fallback = Fallback{context.E , fallbackDC, separatePrecheck};
121
117
continue ;
122
118
123
- case ContextKind::SingleStmtClosure :
119
+ case ContextKind::Closure :
124
120
if (!fallback && context.E != InitialExpr)
125
121
fallback = Fallback{context.E , fallbackDC, separatePrecheck};
126
122
fallbackDC = cast<AbstractClosureExpr>(context.E );
127
123
continue ;
128
124
129
- case ContextKind::MultiStmtClosure:
130
- fallbackDC = cast<AbstractClosureExpr>(context.E );
131
- LLVM_FALLTHROUGH;
132
125
case ContextKind::ErrorExpression:;
133
126
fallback = llvm::None;
134
127
separatePrecheck = true ;
0 commit comments