File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -5381,9 +5381,11 @@ void CodeCompletionCallbacksImpl::doneParsing() {
5381
5381
case CompletionKind::AttributeBegin: {
5382
5382
Lookup.getAttributeDeclCompletions (IsInSil, AttTargetDK);
5383
5383
5384
- // Provide any type name for property delegate.
5384
+ // TypeName at attribute position after '@'.
5385
+ // - VarDecl: Property Wrappers.
5386
+ // - ParamDecl/VarDecl/FuncDecl: Function Buildres.
5385
5387
if (!AttTargetDK || *AttTargetDK == DeclKind::Var ||
5386
- *AttTargetDK == DeclKind::Param)
5388
+ *AttTargetDK == DeclKind::Param || *AttTargetDK == DeclKind::Func )
5387
5389
Lookup.getTypeCompletionsInDeclContext (
5388
5390
P.Context .SourceMgr .getCodeCompletionLoc ());
5389
5391
break ;
Original file line number Diff line number Diff line change 2
2
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=MEMBER_DECL_ATTR_1 -code-completion-keywords=false | %FileCheck %s -check-prefix=ERROR_COMMON
3
3
4
4
// ERROR_COMMON: found code completion token
5
- // ERROR_COMMON-NOT: Begin completions
5
+ // ERROR_COMMON-NOT: Keyword/
6
6
7
7
@#^TOP_LEVEL_ATTR_1 ^# class TopLevelDeclAttr1 { }
8
8
Original file line number Diff line number Diff line change @@ -59,7 +59,9 @@ func method(){}
59
59
// KEYWORD2-NEXT: Keyword/None: usableFromInline[#Func Attribute#]; name=usableFromInline
60
60
// KEYWORD2-NEXT: Keyword/None: discardableResult[#Func Attribute#]; name=discardableResult
61
61
// KEYWORD2-NEXT: Keyword/None: IBSegueAction[#Func Attribute#]; name=IBSegueAction{{$}}
62
- // KEYWORD2-NEXT: End completions
62
+ // KEYWORD2-NOT: Keyword
63
+ // KEYWORD2: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct
64
+ // KEYWORD2: End completions
63
65
64
66
@#^KEYWORD3 ^#
65
67
class C { }
@@ -171,6 +173,8 @@ struct _S {
171
173
// ON_METHOD-DAG: Keyword/None: usableFromInline[#Func Attribute#]; name=usableFromInline
172
174
// ON_METHOD-DAG: Keyword/None: discardableResult[#Func Attribute#]; name=discardableResult
173
175
// ON_METHOD-DAG: Keyword/None: IBSegueAction[#Func Attribute#]; name=IBSegueAction
176
+ // ON_METHOD-NOT: Keyword
177
+ // ON_METHOD: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct
174
178
// ON_METHOD: End completions
175
179
176
180
func bar( @#^ON_PARAM^#)
You can’t perform that action at this time.
0 commit comments