summaryrefslogtreecommitdiffstats
path: root/clang/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
commit95887f9c5bfc743e1dbc1352ba34bb7f3c3410ea (patch)
tree71de166aac30639db4983d5882b5de38e6875043 /clang/lib/Parse/ParseObjc.cpp
parentcaef9ab03c7a5fa06aeedd22cd0ddd8bd2c09990 (diff)
downloadbcm5719-llvm-95887f9c5bfc743e1dbc1352ba34bb7f3c3410ea.tar.gz
bcm5719-llvm-95887f9c5bfc743e1dbc1352ba34bb7f3c3410ea.zip
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. llvm-svn: 107929
Diffstat (limited to 'clang/lib/Parse/ParseObjc.cpp')
-rw-r--r--clang/lib/Parse/ParseObjc.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseObjc.cpp b/clang/lib/Parse/ParseObjc.cpp
index 849e57799aa..79e432d6114 100644
--- a/clang/lib/Parse/ParseObjc.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud