Skip to content

Commit 867c28e

Browse files
committed
[IDE] Rename collectArgumentExpectation() to analyzeApplyExpr()
Removed unnecessary arguments.
1 parent e3387c6 commit 867c28e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/IDE/CodeCompletion.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5184,25 +5184,27 @@ class ExprContextAnalyzer {
51845184
}
51855185

51865186
/// Collect context information at call argument position.
5187-
bool collectArgumentExpectation(DeclContext &DC, Expr *E, Expr *CCExpr) {
5187+
bool analyzeApplyExpr(Expr *E) {
51885188
// Collect parameter lists for possible func decls.
51895189
SmallVector<FunctionTypeAndDecl, 2> Candidates;
51905190
Expr *Arg = nullptr;
51915191
if (auto *applyExpr = dyn_cast<ApplyExpr>(E)) {
5192-
if (!collectPossibleCalleesForApply(DC, applyExpr, Candidates))
5192+
if (!collectPossibleCalleesForApply(*DC, applyExpr, Candidates))
51935193
return false;
51945194
Arg = applyExpr->getArg();
51955195
} else if (auto *subscriptExpr = dyn_cast<SubscriptExpr>(E)) {
5196-
if (!collectPossibleCalleesForSubscript(DC, subscriptExpr, Candidates))
5196+
if (!collectPossibleCalleesForSubscript(*DC, subscriptExpr, Candidates))
51975197
return false;
51985198
Arg = subscriptExpr->getIndex();
5199+
} else {
5200+
llvm_unreachable("unexpected expression kind");
51995201
}
52005202
PossibleCallees.assign(Candidates.begin(), Candidates.end());
52015203

52025204
// Determine the position of code completion token in call argument.
52035205
unsigned Position;
52045206
bool HasName;
5205-
if (!getPositionInArgs(DC, Arg, CCExpr, Position, HasName))
5207+
if (!getPositionInArgs(*DC, Arg, ParsedExpr, Position, HasName))
52065208
return false;
52075209
if (!translateArgIndexToParamIndex(Arg, Position, HasName))
52085210
return false;
@@ -5243,11 +5245,10 @@ class ExprContextAnalyzer {
52435245
case ExprKind::Subscript:
52445246
case ExprKind::Binary:
52455247
case ExprKind::PrefixUnary: {
5246-
collectArgumentExpectation(*DC, Parent, ParsedExpr);
5248+
analyzeApplyExpr(Parent);
52475249
break;
52485250
}
52495251
case ExprKind::Assign: {
5250-
auto &SM = DC->getASTContext().SourceMgr;
52515252
auto *AE = cast<AssignExpr>(Parent);
52525253

52535254
// Make sure code completion is on the right hand side.

0 commit comments

Comments
 (0)