summaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-01-04 22:19:42 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-01-04 22:19:42 +0000
commit8e0f8b8c96c8b0cf053dbf78cba1d534f05c99a2 (patch)
tree2173cb011a5acb1fa9d98fcd6a549fec31595377 /contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
parentd8c03e73dcf4987b182e9ba75540b289daaffc06 (diff)
parent0c75eea8f661a82866688fd1fc4465883c4dd7d5 (diff)
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp')
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
index d76bde574677..3eef366b75b3 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp
@@ -7471,6 +7471,23 @@ void Sema::CodeCompleteObjCMethodDeclSelector(Scope *S,
}
Results.ExitScope();
+
+ if (!AtParameterName && !SelIdents.empty() &&
+ SelIdents.front()->getName().startswith("init")) {
+ for (const auto &M : PP.macros()) {
+ if (M.first->getName() != "NS_DESIGNATED_INITIALIZER")
+ continue;
+ Results.EnterNewScope();
+ CodeCompletionBuilder Builder(Results.getAllocator(),
+ Results.getCodeCompletionTUInfo());
+ Builder.AddTypedTextChunk(
+ Builder.getAllocator().CopyString(M.first->getName()));
+ Results.AddResult(CodeCompletionResult(Builder.TakeString(), CCP_Macro,
+ CXCursor_MacroDefinition));
+ Results.ExitScope();
+ }
+ }
+
HandleCodeCompleteResults(this, CodeCompleter,
CodeCompletionContext::CCC_Other,
Results.data(),Results.size());