diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-26 16:46:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-26 16:46:39 +0000 |
commit | 2d9e21f4675232a39a39611a5b4bb1f4914b2742 (patch) | |
tree | 675174747ef424bd5781c58e37efaa93cf033efe /lib/Sema/SemaCodeComplete.cpp | |
parent | 3cdee121daa13403335094ce0e181b9911c2124c (diff) |
Tweak the @selector completion to collapse multiple informative and
typed-text blocks into one of each.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112194 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 392152630d..4c06fac012 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -4064,16 +4064,19 @@ void Sema::CodeCompleteObjCSelector(Scope *S, IdentifierInfo **SelIdents, continue; } + std::string Accumulator; for (unsigned I = 0, N = Sel.getNumArgs(); I != N; ++I) { - std::string Piece = Sel.getIdentifierInfoForSlot(I)->getName().str(); - Piece += ':'; - if (I < NumSelIdents) - Pattern->AddInformativeChunk(Piece); - else if (I == NumSelIdents) - Pattern->AddTypedTextChunk(Piece); - else - Pattern->AddTextChunk(Piece); + if (I == NumSelIdents) { + if (!Accumulator.empty()) { + Pattern->AddInformativeChunk(Accumulator); + Accumulator.clear(); + } + } + + Accumulator += Sel.getIdentifierInfoForSlot(I)->getName().str(); + Accumulator += ':'; } + Pattern->AddTypedTextChunk(Accumulator); Results.AddResult(Pattern); } Results.ExitScope(); |