|
10 | 10 | // RUN: %FileCheck %s -check-prefix=CONSTRUCTOR_SELF_DOT_1 < %t.self.txt
|
11 | 11 | // RUN: %FileCheck %s -check-prefix=COMMON_SELF_DOT_1 < %t.self.txt
|
12 | 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 | + |
13 | 17 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CONSTRUCTOR_NONSELF_DOT_1 > %t.self.txt
|
14 | 18 | // RUN: %FileCheck %s -check-prefix=COMMON_SELF_DOT_1 < %t.self.txt
|
15 | 19 | // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
|
|
49 | 53 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_CONSTRUCTOR_NONSELF_DOT_1 > %t.self.txt
|
50 | 54 | // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
|
51 | 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 | + |
52 | 60 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_FUNC_SELF_DOT_1 > %t.self.txt
|
53 | 61 | // RUN: %FileCheck %s -check-prefix=NO_INIT < %t.self.txt
|
54 | 62 |
|
@@ -177,16 +185,24 @@ class ThisDerived1 : ThisBase1 {
|
177 | 185 | // NO_INIT-NOT: init()
|
178 | 186 | }
|
179 | 187 |
|
180 |
| - init(a : Int) { |
| 188 | + init(a: Int) { |
181 | 189 | self.#^CONSTRUCTOR_SELF_DOT_1^#
|
182 | 190 | // CONSTRUCTOR_SELF_DOT_1: Begin completions, 16 items
|
183 | 191 | // CONSTRUCTOR_SELF_DOT_1-NOT: Decl[Constructor]
|
184 |
| - |
185 | 192 | // CONSTRUCTOR_SELF_DOT_1: End completions
|
186 | 193 | let d: ThisDerived1
|
187 | 194 | d.#^CONSTRUCTOR_NONSELF_DOT_1^#
|
188 | 195 | }
|
189 | 196 |
|
| 197 | + convenience init(conv: Int) { |
| 198 | + self.#^CONVENIENCE_SELF_DOT_1^# |
| 199 | +// CONVENIENCE_SELF_DOT_1: Begin completions, 20 items |
| 200 | +// CONVENIENCE_SELF_DOT_1-DAG: Decl[Constructor]/CurrNominal: init()[#ThisDerived1#]; name=init() |
| 201 | +// CONVENIENCE_SELF_DOT_1-DAG: Decl[Constructor]/CurrNominal: init({#a: Int#})[#ThisDerived1#]; name=init(a: Int) |
| 202 | +// CONVENIENCE_SELF_DOT_1-DAG: Decl[Constructor]/CurrNominal: init({#conv: Int#})[#ThisDerived1#]; name=init(conv: Int) |
| 203 | +// CONVENIENCE_SELF_DOT_1: End completions |
| 204 | + } |
| 205 | + |
190 | 206 | deinit {
|
191 | 207 | self#^DESTRUCTOR_SELF_NO_DOT_1^#
|
192 | 208 | // DESTRUCTOR_SELF_NO_DOT_1: Begin completions, 21 items
|
@@ -217,6 +233,7 @@ class ThisDerived1 : ThisBase1 {
|
217 | 233 | // FUNC_STATIC_SELF_NO_DOT_1-NEXT: Decl[StaticMethod]/CurrNominal: .derivedStaticFunc0()[#Void#]
|
218 | 234 | // FUNC_STATIC_SELF_NO_DOT_1-NEXT: Decl[Constructor]/CurrNominal: .init()[#ThisDerived1#]
|
219 | 235 | // FUNC_STATIC_SELF_NO_DOT_1-NEXT: Decl[Constructor]/CurrNominal: .init({#a: Int#})[#ThisDerived1#]
|
| 236 | +// FUNC_STATIC_SELF_NO_DOT_1-NEXT: Decl[Constructor]/CurrNominal: .init({#conv: Int#})[#ThisDerived1#] |
220 | 237 | // FUNC_STATIC_SELF_NO_DOT_1-NEXT: Decl[InstanceMethod]/CurrNominal: .test1({#(self): ThisDerived1#})[#() -> Void#]
|
221 | 238 | // FUNC_STATIC_SELF_NO_DOT_1-NEXT: Decl[InstanceMethod]/CurrNominal: .test2({#(self): ThisDerived1#})[#() -> Void#]
|
222 | 239 | // FUNC_STATIC_SELF_NO_DOT_1-NEXT: Decl[StaticMethod]/CurrNominal: .staticTest1()[#Void#]
|
@@ -251,6 +268,7 @@ class ThisDerived1 : ThisBase1 {
|
251 | 268 | // FUNC_STATIC_SELF_DOT_1-NEXT: Decl[StaticMethod]/CurrNominal: derivedStaticFunc0()[#Void#]
|
252 | 269 | // FUNC_STATIC_SELF_DOT_1-NEXT: Decl[Constructor]/CurrNominal: init()[#ThisDerived1#]
|
253 | 270 | // FUNC_STATIC_SELF_DOT_1-NEXT: Decl[Constructor]/CurrNominal: init({#a: Int#})[#ThisDerived1#]
|
| 271 | +// FUNC_STATIC_SELF_DOT_1-NEXT: Decl[Constructor]/CurrNominal: init({#conv: Int#})[#ThisDerived1#] |
254 | 272 | // FUNC_STATIC_SELF_DOT_1-NEXT: Decl[InstanceMethod]/CurrNominal: test1({#(self): ThisDerived1#})[#() -> Void#]
|
255 | 273 | // FUNC_STATIC_SELF_DOT_1-NEXT: Decl[InstanceMethod]/CurrNominal: test2({#(self): ThisDerived1#})[#() -> Void#]
|
256 | 274 | // FUNC_STATIC_SELF_DOT_1-NEXT: Decl[StaticMethod]/CurrNominal: staticTest1()[#Void#]
|
@@ -312,17 +330,24 @@ extension ThisDerived1 {
|
312 | 330 |
|
313 | 331 | convenience init(someExtensionArg: Int) {
|
314 | 332 | self.#^EXTENSION_CONSTRUCTOR_SELF_DOT_1^#
|
| 333 | +// EXTENSION_CONSTRUCTOR_SELF_DOT_1: Begin completions, 20 items |
| 334 | +// EXTENSION_CONSTRUCTOR_SELF_DOT_1: Decl[Constructor]/CurrNominal: init()[#ThisDerived1#]; name=init() |
| 335 | +// EXTENSION_CONSTRUCTOR_SELF_DOT_1: Decl[Constructor]/CurrNominal: init({#a: Int#})[#ThisDerived1#]; name=init(a: Int) |
| 336 | +// EXTENSION_CONSTRUCTOR_SELF_DOT_1: Decl[Constructor]/CurrNominal: init({#someExtensionArg: Int#})[#ThisDerived1#]; name=init(someExtensionArg: Int) |
| 337 | +// EXTENSION_CONSTRUCTOR_SELF_DOT_1: End completions |
| 338 | + |
315 | 339 | }
|
316 | 340 | }
|
317 | 341 |
|
318 | 342 | struct S1 {
|
319 | 343 | init() {}
|
320 | 344 | init(x: Int) {
|
321 | 345 | self.#^STRUCT_CONSTRUCTOR_SELF_DOT_1^#
|
322 |
| -// STRUCT_CONSTRUCTOR_SELF_DOT_1: Begin completions, 2 items |
323 |
| -// STRUCT_CONSTRUCTOR_SELF_DOT_1-DAG: Keyword[self]/CurrNominal: self[#S1#]; name=self |
324 |
| -// STRUCT_CONSTRUCTOR_SELF_DOT_1-NOT: Decl[Constructor] |
325 |
| -// STRUCT_CONSTRUCTOR_SELF_DOT_1-DAG: Decl[InstanceMethod]/CurrNominal: f()[#Void#]; |
| 346 | +// STRUCT_CONSTRUCTOR_SELF_DOT_1: Begin completions, 4 items |
| 347 | +// STRUCT_CONSTRUCTOR_SELF_DOT_1-DAG: Keyword[self]/CurrNominal: self[#S1#]; name=self |
| 348 | +// STRUCT_CONSTRUCTOR_SELF_DOT_1-DAG: Decl[Constructor]/CurrNominal: init()[#S1#]; name=init() |
| 349 | +// STRUCT_CONSTRUCTOR_SELF_DOT_1-DAG: Decl[Constructor]/CurrNominal: init({#x: Int#})[#S1#]; name=init(x: Int) |
| 350 | +// STRUCT_CONSTRUCTOR_SELF_DOT_1-DAG: Decl[InstanceMethod]/CurrNominal: f()[#Void#]; name=f() |
326 | 351 | // STRUCT_CONSTRUCTOR_SELF_DOT_1: End completions
|
327 | 352 | let s: S1
|
328 | 353 | s.#^STRUCT_CONSTRUCTOR_NONSELF_DOT_1^#
|
|
0 commit comments