[CodeCompletion] Add a block property setter completion result
This commit changes code completion results for Objective-C block properties:
clang now suggests an additional completion result that displays the block
property together with '=' and the block literal placeholder for the appropriate
readwrite block properties.
This commit uses a simple heuristic to determine when it's appropriate to
suggest a setter completion for block properties: the additional block setter
completion is provided iff the member access that's being completed is a
standalone statement.
rdar://28481726
Differential Revision: https://reviews.llvm.org/D25520
llvm-svn: 284472
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp
index d0557b8..30e392f 100644
--- a/clang/lib/Parse/ParseStmt.cpp
+++ b/clang/lib/Parse/ParseStmt.cpp
@@ -396,6 +396,8 @@
// If a case keyword is missing, this is where it should be inserted.
Token OldToken = Tok;
+ ExprStatementTokLoc = Tok.getLocation();
+
// expression[opt] ';'
ExprResult Expr(ParseExpression());
if (Expr.isInvalid()) {