[CodeCompletion] Enable custom attribute completion for func decl

rdar://problem/50352482
This commit is contained in:
Rintaro Ishizaki
2019-06-17 16:08:22 -07:00
parent 0f2b753518
commit be2fabe762
3 changed files with 10 additions and 4 deletions

View File

@@ -5375,9 +5375,11 @@ void CodeCompletionCallbacksImpl::doneParsing() {
case CompletionKind::AttributeBegin: {
Lookup.getAttributeDeclCompletions(IsInSil, AttTargetDK);
// Provide any type name for property delegate.
// TypeName at attribute position after '@'.
// - VarDecl: Property Wrappers.
// - ParamDecl/VarDecl/FuncDecl: Function Buildres.
if (!AttTargetDK || *AttTargetDK == DeclKind::Var ||
*AttTargetDK == DeclKind::Param)
*AttTargetDK == DeclKind::Param || *AttTargetDK == DeclKind::Func)
Lookup.getTypeCompletionsInDeclContext(
P.Context.SourceMgr.getCodeCompletionLoc());
break;