@@ -259,7 +259,6 @@ class CodeCompletionCallbacksImpl : public CodeCompletionCallbacks,
259259 void completeForEachSequenceBeginning (CodeCompletionExpr *E) override ;
260260 void completeForEachInKeyword () override ;
261261 void completePostfixExpr (CodeCompletionExpr *E, bool hasSpace) override ;
262- void completePostfixExprParen (Expr *E, Expr *CodeCompletionE) override ;
263262 void completeExprKeyPath (KeyPathExpr *KPE, SourceLoc DotLoc) override ;
264263
265264 void completeTypeDeclResultBeginning () override ;
@@ -419,32 +418,6 @@ void CodeCompletionCallbacksImpl::completePostfixExpr(CodeCompletionExpr *E,
419418 CurDeclContext = P.CurDeclContext ;
420419}
421420
422- void CodeCompletionCallbacksImpl::completePostfixExprParen (Expr *E,
423- Expr *CodeCompletionE) {
424- assert (P.Tok .is (tok::code_complete));
425-
426- // Don't produce any results in an enum element.
427- if (InEnumElementRawValue)
428- return ;
429-
430- Kind = CompletionKind::PostfixExprParen;
431- ParsedExpr = E;
432- CurDeclContext = P.CurDeclContext ;
433- CodeCompleteTokenExpr = static_cast <CodeCompletionExpr*>(CodeCompletionE);
434-
435- ShouldCompleteCallPatternAfterParen = true ;
436- if (CompletionContext.getCallPatternHeuristics ()) {
437- // Lookahead one token to decide what kind of call completions to provide.
438- // When it appears that there is already code for the call present, just
439- // complete values and/or argument labels. Otherwise give the entire call
440- // pattern.
441- Token next = P.peekToken ();
442- if (!next.isAtStartOfLine () && !next.is (tok::eof) && !next.is (tok::r_paren)) {
443- ShouldCompleteCallPatternAfterParen = false ;
444- }
445- }
446- }
447-
448421void CodeCompletionCallbacksImpl::completeExprKeyPath (KeyPathExpr *KPE,
449422 SourceLoc DotLoc) {
450423 Kind = (!KPE || KPE->isObjC ()) ? CompletionKind::KeyPathExprObjC
@@ -1075,7 +1048,6 @@ void CodeCompletionCallbacksImpl::addKeywords(CodeCompletionResultSink &Sink,
10751048 break ;
10761049
10771050 case CompletionKind::CallArg:
1078- case CompletionKind::PostfixExprParen:
10791051 // Note that we don't add keywords here as the completion might be for
10801052 // an argument list pattern. We instead add keywords later in
10811053 // CodeCompletionCallbacksImpl::doneParsing when we know we're not
@@ -1554,8 +1526,7 @@ void CodeCompletionCallbacksImpl::postfixCompletion(SourceLoc CompletionLoc,
15541526 Context.CompletionCallback , &Lookup);
15551527 typeCheckContextAt (TypeCheckASTNodeAtLocContext::node (CurDeclContext, AE),
15561528 CompletionLoc);
1557- Lookup.collectResults (/* IncludeSignature=*/ false ,
1558- /* IsLabeledTrailingClosure=*/ true , CompletionLoc,
1529+ Lookup.collectResults (/* IsLabeledTrailingClosure=*/ true , CompletionLoc,
15591530 CurDeclContext, CompletionContext);
15601531 }
15611532 }
@@ -1599,8 +1570,7 @@ void CodeCompletionCallbacksImpl::callCompletion(SourceLoc CompletionLoc,
15991570 CurDeclContext);
16001571 typeCheckWithLookup (Lookup, CompletionLoc);
16011572
1602- Lookup.collectResults (ShouldCompleteCallPatternAfterParen,
1603- /* IsLabeledTrailingClosure=*/ false , CompletionLoc,
1573+ Lookup.collectResults (/* IsLabeledTrailingClosure=*/ false , CompletionLoc,
16041574 CurDeclContext, CompletionContext);
16051575 Consumer.handleResults (CompletionContext);
16061576}
@@ -1725,7 +1695,6 @@ void CodeCompletionCallbacksImpl::doneParsing(SourceFile *SrcFile) {
17251695 case CompletionKind::KeyPathExprSwift:
17261696 keyPathExprCompletion (CompletionLoc, MaybeFuncBody);
17271697 return ;
1728- case CompletionKind::PostfixExprParen:
17291698 case CompletionKind::CallArg:
17301699 callCompletion (CompletionLoc, MaybeFuncBody);
17311700 return ;
@@ -1773,8 +1742,7 @@ void CodeCompletionCallbacksImpl::doneParsing(SourceFile *SrcFile) {
17731742 ParsedExpr->setType (*ExprType);
17741743 }
17751744
1776- if (!ExprType && Kind != CompletionKind::PostfixExprParen &&
1777- Kind != CompletionKind::CallArg &&
1745+ if (!ExprType && Kind != CompletionKind::CallArg &&
17781746 Kind != CompletionKind::KeyPathExprObjC)
17791747 return ;
17801748 }
@@ -1810,7 +1778,6 @@ void CodeCompletionCallbacksImpl::doneParsing(SourceFile *SrcFile) {
18101778 case CompletionKind::AfterPoundExpr:
18111779 case CompletionKind::AccessorBeginning:
18121780 case CompletionKind::CaseStmtBeginning:
1813- case CompletionKind::PostfixExprParen:
18141781 case CompletionKind::PostfixExpr:
18151782 case CompletionKind::ReturnStmtExpr:
18161783 case CompletionKind::YieldStmtExpr:
0 commit comments