1
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CONSTRUCTOR_SELF_NO_DOT_1 > %t.self.txt
2
- // RUN: %FileCheck %s -check-prefix=CONSTRUCTOR_SELF_NO_DOT_1 < %t.self.txt
3
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_NO_DOT_1 < %t.self.txt
4
-
5
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CONSTRUCTOR_NONSELF_NO_DOT_1 > %t.self.txt
6
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_NO_DOT_1 < %t.self.txt
7
- // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
8
-
9
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CONSTRUCTOR_SELF_DOT_1 > %t.self.txt
10
- // RUN: %FileCheck %s -check-prefix=CONSTRUCTOR_SELF_DOT_1 < %t.self.txt
11
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_DOT_1 < %t.self.txt
12
-
13
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CONVENIENCE_SELF_DOT_1 > %t.self.txt
14
- // RUN: %FileCheck %s -check-prefix=CONVENIENCE_SELF_DOT_1 < %t.self.txt
15
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_DOT_1 < %t.self.txt
16
-
17
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CONSTRUCTOR_NONSELF_DOT_1 > %t.self.txt
18
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_DOT_1 < %t.self.txt
19
- // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
20
-
21
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DESTRUCTOR_SELF_NO_DOT_1 > %t.self.txt
22
- // RUN: %FileCheck %s -check-prefix=DESTRUCTOR_SELF_NO_DOT_1 < %t.self.txt
23
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_NO_DOT_1 < %t.self.txt
24
- // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
25
-
26
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DESTRUCTOR_SELF_DOT_1 > %t.self.txt
27
- // RUN: %FileCheck %s -check-prefix=DESTRUCTOR_SELF_DOT_1 < %t.self.txt
28
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_DOT_1 < %t.self.txt
29
- // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
30
-
31
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=FUNC_SELF_NO_DOT_1 > %t.self.txt
32
- // RUN: %FileCheck %s -check-prefix=FUNC_SELF_NO_DOT_1 < %t.self.txt
33
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_NO_DOT_1 < %t.self.txt
34
- // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
35
-
36
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STATIC_SELF_PAREN > %t.self.txt
37
- // RUN: %FileCheck %s -check-prefix=STATIC_SELF_PAREN < %t.self.txt
38
-
39
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=FUNC_SELF_DOT_1 > %t.self.txt
40
- // RUN: %FileCheck %s -check-prefix=FUNC_SELF_DOT_1 < %t.self.txt
41
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_DOT_1 < %t.self.txt
42
- // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
43
-
44
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=FUNC_STATIC_SELF_NO_DOT_1 > %t.self.txt
45
- // RUN: %FileCheck %s -check-prefix=FUNC_STATIC_SELF_NO_DOT_1 < %t.self.txt
46
-
47
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=FUNC_STATIC_SELF_DOT_1 > %t.self.txt
48
- // RUN: %FileCheck %s -check-prefix=FUNC_STATIC_SELF_DOT_1 < %t.self.txt
49
-
50
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_CONSTRUCTOR_SELF_DOT_1 > %t.self.txt
51
- // RUN: %FileCheck %s -check-prefix=STRUCT_CONSTRUCTOR_SELF_DOT_1 < %t.self.txt
52
-
53
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_CONSTRUCTOR_NONSELF_DOT_1 > %t.self.txt
54
- // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
55
-
56
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXTENSION_CONSTRUCTOR_SELF_DOT_1 > %t.self.txt
57
- // RUN: %FileCheck %s -check-prefix=COMMON_SELF_DOT_1 < %t.self.txt
58
- // RUN: %FileCheck %s -check-prefix=EXTENSION_CONSTRUCTOR_SELF_DOT_1 < %t.self.txt
59
-
60
- // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_FUNC_SELF_DOT_1 > %t.self.txt
61
- // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t
62
3
63
4
//===---
64
5
//===--- Tests for code completion after 'self'.
@@ -176,26 +117,26 @@ class ThisDerived1 : ThisBase1 {
176
117
// COMMON_SELF_DOT_1: End completions
177
118
178
119
init ( ) {
179
- self#^CONSTRUCTOR_SELF_NO_DOT_1^#
120
+ self#^CONSTRUCTOR_SELF_NO_DOT_1? check = CONSTRUCTOR_SELF_NO_DOT_1;check = COMMON_SELF_NO_DOT_1 ^#
180
121
// CONSTRUCTOR_SELF_NO_DOT_1: Begin completions, 21 items
181
122
// CONSTRUCTOR_SELF_NO_DOT_1-NOT: Decl[Constructor]
182
123
// CONSTRUCTOR_SELF_NO_DOT_1: End completions
183
124
let d : ThisDerived1
184
- d#^CONSTRUCTOR_NONSELF_NO_DOT_1^#
125
+ d#^CONSTRUCTOR_NONSELF_NO_DOT_1? check = COMMON_SELF_NO_DOT_1;check = NO_INIT ^#
185
126
// NO_INIT-NOT: init()
186
127
}
187
128
188
129
init ( a: Int ) {
189
- self . #^CONSTRUCTOR_SELF_DOT_1^#
130
+ self . #^CONSTRUCTOR_SELF_DOT_1? check = CONSTRUCTOR_SELF_DOT_1;check = COMMON_SELF_DOT_1 ^#
190
131
// CONSTRUCTOR_SELF_DOT_1: Begin completions, 16 items
191
132
// CONSTRUCTOR_SELF_DOT_1-NOT: Decl[Constructor]
192
133
// CONSTRUCTOR_SELF_DOT_1: End completions
193
134
let d : ThisDerived1
194
- d. #^CONSTRUCTOR_NONSELF_DOT_1^#
135
+ d. #^CONSTRUCTOR_NONSELF_DOT_1? check = COMMON_SELF_DOT_1;check = NO_INIT ^#
195
136
}
196
137
197
138
convenience init ( conv: Int ) {
198
- self . #^CONVENIENCE_SELF_DOT_1^#
139
+ self . #^CONVENIENCE_SELF_DOT_1? check = CONVENIENCE_SELF_DOT_1;check = COMMON_SELF_DOT_1 ^#
199
140
// CONVENIENCE_SELF_DOT_1: Begin completions, 20 items
200
141
// CONVENIENCE_SELF_DOT_1-DAG: Decl[Constructor]/CurrNominal: init()[#ThisDerived1#]; name=init()
201
142
// CONVENIENCE_SELF_DOT_1-DAG: Decl[Constructor]/CurrNominal: init({#a: Int#})[#ThisDerived1#]; name=init(a: Int)
@@ -204,23 +145,23 @@ class ThisDerived1 : ThisBase1 {
204
145
}
205
146
206
147
deinit {
207
- self#^DESTRUCTOR_SELF_NO_DOT_1^#
148
+ self#^DESTRUCTOR_SELF_NO_DOT_1? check = DESTRUCTOR_SELF_NO_DOT_1;check = COMMON_SELF_NO_DOT_1;check = NO_INIT ^#
208
149
// DESTRUCTOR_SELF_NO_DOT_1: Begin completions, 21 items
209
150
// DESTRUCTOR_SELF_NO_DOT_1: End completions
210
151
211
- self . #^DESTRUCTOR_SELF_DOT_1^#
152
+ self . #^DESTRUCTOR_SELF_DOT_1? check = DESTRUCTOR_SELF_DOT_1;check = COMMON_SELF_DOT_1;check = NO_INIT ^#
212
153
// DESTRUCTOR_SELF_DOT_1: Begin completions, 16 items
213
154
// DESTRUCTOR_SELF_DOT_1: End completions
214
155
}
215
156
216
157
func test1( ) {
217
- self#^FUNC_SELF_NO_DOT_1^#
158
+ self#^FUNC_SELF_NO_DOT_1? check = FUNC_SELF_NO_DOT_1;check = COMMON_SELF_NO_DOT_1;check = NO_INIT ^#
218
159
// FUNC_SELF_NO_DOT_1: Begin completions, 21 items
219
160
// FUNC_SELF_NO_DOT_1: End completions
220
161
}
221
162
222
163
func test2( ) {
223
- self . #^FUNC_SELF_DOT_1^#
164
+ self . #^FUNC_SELF_DOT_1? check = FUNC_SELF_DOT_1;check = COMMON_SELF_DOT_1;check = NO_INIT ^#
224
165
// FUNC_SELF_DOT_1: Begin completions, 16 items
225
166
// FUNC_SELF_DOT_1: End completions
226
167
}
@@ -329,7 +270,7 @@ extension ThisDerived1 {
329
270
typealias DerivedExtNestedTypealias = Int
330
271
331
272
convenience init ( someExtensionArg: Int ) {
332
- self . #^EXTENSION_CONSTRUCTOR_SELF_DOT_1^#
273
+ self . #^EXTENSION_CONSTRUCTOR_SELF_DOT_1? check = COMMON_SELF_DOT_1;check = EXTENSION_CONSTRUCTOR_SELF_DOT_1 ^#
333
274
// EXTENSION_CONSTRUCTOR_SELF_DOT_1: Begin completions, 20 items
334
275
// EXTENSION_CONSTRUCTOR_SELF_DOT_1: Decl[Constructor]/CurrNominal: init()[#ThisDerived1#]; name=init()
335
276
// EXTENSION_CONSTRUCTOR_SELF_DOT_1: Decl[Constructor]/CurrNominal: init({#a: Int#})[#ThisDerived1#]; name=init(a: Int)
@@ -350,9 +291,9 @@ struct S1 {
350
291
// STRUCT_CONSTRUCTOR_SELF_DOT_1-DAG: Decl[InstanceMethod]/CurrNominal: f()[#Void#]; name=f()
351
292
// STRUCT_CONSTRUCTOR_SELF_DOT_1: End completions
352
293
let s : S1
353
- s. #^STRUCT_CONSTRUCTOR_NONSELF_DOT_1^#
294
+ s. #^STRUCT_CONSTRUCTOR_NONSELF_DOT_1? check = NO_INIT ^#
354
295
}
355
296
func f( ) {
356
- self . #^STRUCT_FUNC_SELF_DOT_1^#
297
+ self . #^STRUCT_FUNC_SELF_DOT_1? check = NO_INIT ^#
357
298
}
358
299
}
0 commit comments