aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseObjc.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-07-08 23:20:03 +0000
committerDouglas Gregor <dgregor@apple.com>2010-07-08 23:20:03 +0000
commit1f5537aaac1e775aff1d523f2cc59a9a3bd6c946 (patch)
treed61e423416f688e07af1f00b0d5a101f1569f212 /lib/Parse/ParseObjc.cpp
parentcddc69fc3fe17b043a287a41e3706766c3d09a79 (diff)
Introduce a new code-completion point prior to an identifier in the
selector of an Objective-C method declaration, e.g., given - (int)first:(int)x second:(int)y; this code completion point triggers at the location of "second". It will provide completions that fill out the method declaration for any known method, anywhere in the translation unit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseObjc.cpp')
-rw-r--r--lib/Parse/ParseObjc.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp
index 849e57799a..79e432d611 100644
--- a/lib/Parse/ParseObjc.cpp
+++ b/lib/Parse/ParseObjc.cpp
@@ -868,6 +868,17 @@ Parser::DeclPtrTy Parser::ParseObjCMethodDecl(SourceLocation mLoc,
ArgInfos.push_back(ArgInfo);
KeyIdents.push_back(SelIdent);
+ // Code completion for the next piece of the selector.
+ if (Tok.is(tok::code_completion)) {
+ ConsumeCodeCompletionToken();
+ Actions.CodeCompleteObjCMethodDeclSelector(getCurScope(),
+ mType == tok::minus,
+ ReturnType,
+ KeyIdents.data(),
+ KeyIdents.size());
+ break;
+ }
+
// Check for another keyword selector.
SourceLocation Loc;
SelIdent = ParseObjCSelectorPiece(Loc);