Reapply "[CodeCompletion] Don't show the loop index before it is visible"

With the tests updated to account for not having the correct behaviour
for brace-stmt items from after the code-completion point.  That part
turns out to be harder to fix.

This reverts commit a5325e6281.
This commit is contained in:
Ben Langmuir
2016-03-09 13:09:17 -08:00
parent f6b969ff2e
commit 19d13c3aee
3 changed files with 50 additions and 3 deletions

View File

@@ -2463,8 +2463,6 @@ ParserResult<Stmt> Parser::parseStmtForEach(SourceLoc ForLoc,
ParserResult<Expr> Where;
if (consumeIf(tok::kw_where)) {
Where = parseExprBasic(diag::expected_foreach_where_expr);
if (Where.hasCodeCompletion())
return makeParserCodeCompletionResult<Stmt>();
if (Where.isNull())
Where = makeParserErrorResult(new (Context) ErrorExpr(Tok.getLoc()));
Status |= Where;