aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--lib/Sema/SemaCodeComplete.cpp19
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();