1919// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD_INDEPENDENT_2 | %FileCheck %s -check-prefix=KEYWORD_LAST
2020// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD_LAST | %FileCheck %s -check-prefix=KEYWORD_LAST
2121
22+ // NOTE: If you want to test code completion for an experimental feature, please
23+ // put your tests in complete_decl_attribute_feature_requirement.swift, not
24+ // here. That file has the infrastructure to test that completions are not
25+ // offered when the feature is disabled.
26+
2227struct MyStruct { }
2328
2429@propertyWrapper
@@ -112,6 +117,7 @@ actor MyGenericGlobalActor<T> {
112117// KEYWORD2-NEXT: Keyword/None: preconcurrency[#Func Attribute#]; name=preconcurrency
113118// KEYWORD2-NEXT: Keyword/None: backDeployed[#Func Attribute#]; name=backDeployed
114119// KEYWORD2-NEXT: Keyword/None: lifetime[#Func Attribute#]; name=lifetime
120+ // KEYWORD2-NEXT: Keyword/None: abi[#Func Attribute#]; name=abi{{$}}
115121// KEYWORD2-NEXT: Keyword/None: concurrent[#Func Attribute#]; name=concurrent
116122// KEYWORD2-NOT: Keyword
117123// KEYWORD2-DAG: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct
@@ -169,6 +175,7 @@ actor MyGenericGlobalActor<T> {
169175// KEYWORD5-NEXT: Keyword/None: preconcurrency[#Struct Attribute#]; name=preconcurrency
170176
171177@#^ON_GLOBALVAR^# var globalVar
178+ // ON_GLOBALVAR-DAG: Keyword/None: abi[#Var Attribute#]; name=abi
172179// ON_GLOBALVAR-DAG: Keyword/None: available[#Var Attribute#]; name=available
173180// ON_GLOBALVAR-DAG: Keyword/None: objc[#Var Attribute#]; name=objc
174181// ON_GLOBALVAR-DAG: Keyword/None: NSCopying[#Var Attribute#]; name=NSCopying
@@ -197,6 +204,7 @@ actor MyGenericGlobalActor<T> {
197204
198205struct _S {
199206 @#^ON_INIT^# init( )
207+ // ON_INIT-DAG: Keyword/None: abi[#Constructor Attribute#]; name=abi
200208// ON_INIT-DAG: Keyword/None: available[#Constructor Attribute#]; name=available
201209// ON_INIT-DAG: Keyword/None: objc[#Constructor Attribute#]; name=objc
202210// ON_INIT-DAG: Keyword/None: inline[#Constructor Attribute#]; name=inline
@@ -207,6 +215,7 @@ struct _S {
207215// ON_INIT-DAG: Keyword/None: preconcurrency[#Constructor Attribute#]; name=preconcurrency
208216
209217 @#^ON_PROPERTY^# var foo
218+ // ON_PROPERTY-DAG: Keyword/None: abi[#Var Attribute#]; name=abi
210219// ON_PROPERTY-DAG: Keyword/None: available[#Var Attribute#]; name=available
211220// ON_PROPERTY-DAG: Keyword/None: objc[#Var Attribute#]; name=objc
212221// ON_PROPERTY-DAG: Keyword/None: NSCopying[#Var Attribute#]; name=NSCopying
@@ -234,8 +243,12 @@ struct _S {
234243// ON_PROPERTY-DAG: Decl[Actor]/CurrModule/TypeRelation[Convertible]: MyGenericGlobalActor[#Global Actor#]; name=MyGenericGlobalActor
235244// ON_PROPERTY-NOT: Decl[PrecedenceGroup]
236245
246+ @#^ON_SUBSCR^# subscript
247+ // ON_SUBSCR-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
248+
237249 @#^ON_METHOD^# private
238250 func foo( )
251+ // ON_METHOD-DAG: Keyword/None: abi[#Func Attribute#]; name=abi
239252// ON_METHOD-DAG: Keyword/None: available[#Func Attribute#]; name=available
240253// ON_METHOD-DAG: Keyword/None: objc[#Func Attribute#]; name=objc
241254// ON_METHOD-DAG: Keyword/None: IBAction[#Func Attribute#]; name=IBAction
@@ -293,6 +306,7 @@ struct _S {
293306
294307
295308 @#^ON_MEMBER_LAST^#
309+ // ON_MEMBER_LAST-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
296310// ON_MEMBER_LAST-DAG: Keyword/None: available[#Declaration Attribute#]; name=available
297311// ON_MEMBER_LAST-DAG: Keyword/None: objc[#Declaration Attribute#]; name=objc
298312// ON_MEMBER_LAST-DAG: Keyword/None: dynamicCallable[#Declaration Attribute#]; name=dynamicCallable
@@ -347,6 +361,8 @@ func takeClosure(_: () -> Void) {
347361 print ( " x " )
348362 }
349363}
364+ // FIXME: Not valid in this position (but CompletionLookup can't tell that)
365+ // IN_CLOSURE-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
350366// FIXME: We should mark MyPropertyWrapper and MyResultBuilder as Unrelated
351367// IN_CLOSURE-DAG: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct
352368// IN_CLOSURE-DAG: Decl[Struct]/CurrModule/TypeRelation[Convertible]: MyPropertyWrapper[#Property Wrapper#]; name=MyPropertyWrapper
@@ -365,6 +381,7 @@ func dummy2() {}
365381
366382@#^KEYWORD_LAST^#
367383
384+ // KEYWORD_LAST-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
368385// KEYWORD_LAST-DAG: Keyword/None: available[#Declaration Attribute#]; name=available{{$}}
369386// KEYWORD_LAST-DAG: Keyword/None: freestanding[#Declaration Attribute#]; name=freestanding{{$}}
370387// KEYWORD_LAST-DAG: Keyword/None: objc[#Declaration Attribute#]; name=objc{{$}}
0 commit comments