19
19
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD_INDEPENDENT_2 | %FileCheck %s -check-prefix=KEYWORD_LAST
20
20
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=KEYWORD_LAST | %FileCheck %s -check-prefix=KEYWORD_LAST
21
21
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
+
22
27
struct MyStruct { }
23
28
24
29
@propertyWrapper
@@ -111,7 +116,10 @@ actor MyGenericGlobalActor<T> {
111
116
// KEYWORD2-NEXT: Keyword/None: Sendable[#Func Attribute#]; name=Sendable
112
117
// KEYWORD2-NEXT: Keyword/None: preconcurrency[#Func Attribute#]; name=preconcurrency
113
118
// KEYWORD2-NEXT: Keyword/None: backDeployed[#Func Attribute#]; name=backDeployed
114
- // KEYWORD2-NEXT Keyword/None: lifetime[#Func Attribute#]; name=lifetime
119
+ // KEYWORD2-NEXT: Keyword/None: lifetime[#Func Attribute#]; name=lifetime
120
+ // KEYWORD2-NEXT: Keyword/None: abi[#Func Attribute#]; name=abi{{$}}
121
+ // KEYWORD2-NEXT: Keyword/None: concurrent[#Func Attribute#]; name=concurrent
122
+ // KEYWORD2-NOT: Keyword
115
123
// KEYWORD2-DAG: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct
116
124
// KEYWORD2-DAG: Decl[Struct]/CurrModule: MyPropertyWrapper[#Property Wrapper#]; name=MyPropertyWrapper
117
125
// KEYWORD2-DAG: Decl[Struct]/CurrModule/TypeRelation[Convertible]: MyResultBuilder[#Result Builder#]; name=MyResultBuilder
@@ -167,6 +175,7 @@ actor MyGenericGlobalActor<T> {
167
175
// KEYWORD5-NEXT: Keyword/None: preconcurrency[#Struct Attribute#]; name=preconcurrency
168
176
169
177
@#^ON_GLOBALVAR^# var globalVar
178
+ // ON_GLOBALVAR-DAG: Keyword/None: abi[#Var Attribute#]; name=abi
170
179
// ON_GLOBALVAR-DAG: Keyword/None: available[#Var Attribute#]; name=available
171
180
// ON_GLOBALVAR-DAG: Keyword/None: objc[#Var Attribute#]; name=objc
172
181
// ON_GLOBALVAR-DAG: Keyword/None: NSCopying[#Var Attribute#]; name=NSCopying
@@ -195,6 +204,7 @@ actor MyGenericGlobalActor<T> {
195
204
196
205
struct _S {
197
206
@#^ON_INIT^# init( )
207
+ // ON_INIT-DAG: Keyword/None: abi[#Constructor Attribute#]; name=abi
198
208
// ON_INIT-DAG: Keyword/None: available[#Constructor Attribute#]; name=available
199
209
// ON_INIT-DAG: Keyword/None: objc[#Constructor Attribute#]; name=objc
200
210
// ON_INIT-DAG: Keyword/None: inline[#Constructor Attribute#]; name=inline
@@ -205,6 +215,7 @@ struct _S {
205
215
// ON_INIT-DAG: Keyword/None: preconcurrency[#Constructor Attribute#]; name=preconcurrency
206
216
207
217
@#^ON_PROPERTY^# var foo
218
+ // ON_PROPERTY-DAG: Keyword/None: abi[#Var Attribute#]; name=abi
208
219
// ON_PROPERTY-DAG: Keyword/None: available[#Var Attribute#]; name=available
209
220
// ON_PROPERTY-DAG: Keyword/None: objc[#Var Attribute#]; name=objc
210
221
// ON_PROPERTY-DAG: Keyword/None: NSCopying[#Var Attribute#]; name=NSCopying
@@ -232,8 +243,12 @@ struct _S {
232
243
// ON_PROPERTY-DAG: Decl[Actor]/CurrModule/TypeRelation[Convertible]: MyGenericGlobalActor[#Global Actor#]; name=MyGenericGlobalActor
233
244
// ON_PROPERTY-NOT: Decl[PrecedenceGroup]
234
245
246
+ @#^ON_SUBSCR^# subscript
247
+ // ON_SUBSCR-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
248
+
235
249
@#^ON_METHOD^# private
236
250
func foo( )
251
+ // ON_METHOD-DAG: Keyword/None: abi[#Func Attribute#]; name=abi
237
252
// ON_METHOD-DAG: Keyword/None: available[#Func Attribute#]; name=available
238
253
// ON_METHOD-DAG: Keyword/None: objc[#Func Attribute#]; name=objc
239
254
// ON_METHOD-DAG: Keyword/None: IBAction[#Func Attribute#]; name=IBAction
@@ -291,6 +306,7 @@ struct _S {
291
306
292
307
293
308
@#^ON_MEMBER_LAST^#
309
+ // ON_MEMBER_LAST-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
294
310
// ON_MEMBER_LAST-DAG: Keyword/None: available[#Declaration Attribute#]; name=available
295
311
// ON_MEMBER_LAST-DAG: Keyword/None: objc[#Declaration Attribute#]; name=objc
296
312
// ON_MEMBER_LAST-DAG: Keyword/None: dynamicCallable[#Declaration Attribute#]; name=dynamicCallable
@@ -345,6 +361,8 @@ func takeClosure(_: () -> Void) {
345
361
print ( " x " )
346
362
}
347
363
}
364
+ // FIXME: Not valid in this position (but CompletionLookup can't tell that)
365
+ // IN_CLOSURE-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
348
366
// FIXME: We should mark MyPropertyWrapper and MyResultBuilder as Unrelated
349
367
// IN_CLOSURE-DAG: Decl[Struct]/CurrModule: MyStruct[#MyStruct#]; name=MyStruct
350
368
// IN_CLOSURE-DAG: Decl[Struct]/CurrModule/TypeRelation[Convertible]: MyPropertyWrapper[#Property Wrapper#]; name=MyPropertyWrapper
@@ -363,6 +381,7 @@ func dummy2() {}
363
381
364
382
@#^KEYWORD_LAST^#
365
383
384
+ // KEYWORD_LAST-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi
366
385
// KEYWORD_LAST-DAG: Keyword/None: available[#Declaration Attribute#]; name=available{{$}}
367
386
// KEYWORD_LAST-DAG: Keyword/None: freestanding[#Declaration Attribute#]; name=freestanding{{$}}
368
387
// KEYWORD_LAST-DAG: Keyword/None: objc[#Declaration Attribute#]; name=objc{{$}}
0 commit comments