1- // RUN: %empty-directory(%t)
2- // RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t
1+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IMPLICIT_CONSTRUCTORS_1 | %FileCheck %s -check-prefix=IMPLICIT_CONSTRUCTORS_1
2+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IMPLICIT_CONSTRUCTORS_1P | %FileCheck %s -check-prefix=IMPLICIT_CONSTRUCTORS_1P
3+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IMPLICIT_CONSTRUCTORS_2 | %FileCheck %s -check-prefix=IMPLICIT_CONSTRUCTORS_2
4+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=IMPLICIT_CONSTRUCTORS_2P | %FileCheck %s -check-prefix=IMPLICIT_CONSTRUCTORS_2P
5+
6+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXPLICIT_CONSTRUCTORS_1 | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_1
7+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXPLICIT_CONSTRUCTORS_1P | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_1P
8+
9+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXPLICIT_CONSTRUCTORS_2 | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_2
10+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXPLICIT_CONSTRUCTORS_2P | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_2P
11+
12+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXPLICIT_CONSTRUCTORS_3P | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_3P
13+
14+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXPLICIT_CONSTRUCTORS_SELECTOR_1 | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_SELECTOR_1
15+
16+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXPLICIT_CONSTRUCTORS_VAL_META_1 | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_VAL_META_1
17+
18+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXPLICIT_CONSTRUCTORS_VAL_META_2 | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_VAL_META_2
19+
20+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=EXPLICIT_CONSTRUCTORS_BASE_DERIVED_1 | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_BASE_DERIVED_1
21+
22+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DEFAULT_INIT_FROM_PROT_NODOT | %FileCheck %s -check-prefix=DEFAULT_INIT_FROM_PROT
23+
24+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DEFAULT_INIT_FROM_PROT_DOT | %FileCheck %s -check-prefix=DEFAULT_INIT_FROM_PROT
25+
26+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DEFAULT_INIT_FROM_PROT_PAREN | %FileCheck %s -check-prefix=DEFAULT_INIT_FROM_PROT
27+
28+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE1 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE1
29+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE2_1 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE2_NOINIT
30+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE2_2 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE2_NOINIT
31+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE2_3 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE2_NOINIT
32+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE2_4 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE2_SHOW_INIT
33+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE2_5 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE2_SHOW_INIT
34+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE2_6 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE2_NOINIT
35+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE3 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE3
36+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE4 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE4
37+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE5 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE4
38+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_FROM_METATYPE6 | %FileCheck %s -check-prefix=INIT_FROM_METATYPE6
39+
40+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=HAVE_RPAREN_1 | %FileCheck %s -check-prefix=HAVE_RPAREN_1
41+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=HAVE_RPAREN_2 | %FileCheck %s -check-prefix=HAVE_RPAREN_2
42+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=HAVE_COMMA_1 -code-complete-call-pattern-heuristics | %FileCheck %s -check-prefix=HAVE_COMMA_1
43+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=HAVE_COMMA_1 | %FileCheck %s -check-prefix=EXPLICIT_CONSTRUCTORS_1P
44+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=WITH_ALIAS_1 | %FileCheck %s -check-prefix=WITH_ALIAS_1
45+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_IN_INIT_1 | %FileCheck %s -check-prefix=CLOSURE_IN_INIT_1
46+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_IN_INIT_2 | %FileCheck %s -check-prefix=CLOSURE_IN_INIT_1
47+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_IN_INIT_3 | %FileCheck %s -check-prefix=CLOSURE_IN_INIT_1
48+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLOSURE_IN_INIT_4 | %FileCheck %s -check-prefix=CLOSURE_IN_INIT_1
49+
50+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_1 | %FileCheck %s -check-prefix=AVAILABLE_1
51+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=AVAILABLE_2 | %FileCheck %s -check-prefix=AVAILABLE_1
52+
53+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DEPENDENT_IN_CLOSURE_1 | %FileCheck %s -check-prefix=DEPENDENT_IN_CLOSURE_1
54+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=DEPENDENT_IN_CLOSURE_2 | %FileCheck %s -check-prefix=DEPENDENT_IN_CLOSURE_2
55+ // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=INIT_WITH_UNRESOLVEDTYPE_1 | %FileCheck %s -check-prefix=INIT_WITH_UNRESOLVEDTYPE_1
356
457func freeFunc( ) { }
558
@@ -143,9 +196,9 @@ func testExplicitConstructorsSelector2() {
143196 ExplicitConstructorsSelector2#^EXPLICIT_CONSTRUCTORS_SELECTOR_2^#
144197// EXPLICIT_CONSTRUCTORS_SELECTOR_2: Begin completions, 6 items
145198// EXPLICIT_CONSTRUCTORS_SELECTOR_2-DAG: Decl[Constructor]/CurrNominal: ({#noArgs: ()#})[#ExplicitConstructorsSelector2#]{{; name=.+$}}
146- // EXPLICIT_CONSTRUCTORS_SELECTOR_2-DAG: Decl[Constructor]/CurrNominal: ({#(a): Int#})[#ExplicitConstructorsSelector2#]{{; name=.+$}}
147- // EXPLICIT_CONSTRUCTORS_SELECTOR_2-DAG: Decl[Constructor]/CurrNominal: ({#(a): Int#}, {#withFloat: Float#})[#ExplicitConstructorsSelector2#]{{; name=.+$}}
148- // EXPLICIT_CONSTRUCTORS_SELECTOR_2-DAG: Decl[Constructor]/CurrNominal: ({#int: Int#}, {#(b): Float#})[#ExplicitConstructorsSelector2#]{{; name=.+$}}
199+ // EXPLICIT_CONSTRUCTORS_SELECTOR_2-DAG: Decl[Constructor]/CurrNominal: ({#Int#})[#ExplicitConstructorsSelector2#]{{; name=.+$}}
200+ // EXPLICIT_CONSTRUCTORS_SELECTOR_2-DAG: Decl[Constructor]/CurrNominal: ({#Int#}, {#withFloat: Float#})[#ExplicitConstructorsSelector2#]{{; name=.+$}}
201+ // EXPLICIT_CONSTRUCTORS_SELECTOR_2-DAG: Decl[Constructor]/CurrNominal: ({#int: Int#}, {#Float#})[#ExplicitConstructorsSelector2#]{{; name=.+$}}
149202// EXPLICIT_CONSTRUCTORS_SELECTOR_2-DAG: Keyword[self]/CurrNominal: .self[#ExplicitConstructorsSelector2.Type#]; name=self
150203// EXPLICIT_CONSTRUCTORS_SELECTOR_2-DAG: Keyword/CurrNominal: .Type[#ExplicitConstructorsSelector2.Type#]; name=Type
151204// EXPLICIT_CONSTRUCTORS_SELECTOR_2: End completions
@@ -165,7 +218,7 @@ class ExplicitConstructorsDerived2 : ExplicitConstructorsBase1 {
165218 init ( ) { }
166219 required init ( a : Int ) { }
167220 class func foo( ) {
168- self . #^INIT_FROM_METATYPE5? check = INIT_FROM_METATYPE4 ^#
221+ self . #^INIT_FROM_METATYPE5^#
169222 }
170223}
171224
@@ -193,12 +246,12 @@ func testGetInitFromMetatype1() {
193246func testGetInitFromMetatype2( ) {
194247 var S1 = ExplicitConstructorsBase1 . self
195248 var S2 = ExplicitConstructorsDerived2 . self
196- S1. #^INIT_FROM_METATYPE2_1? check = INIT_FROM_METATYPE2_NOINIT ^#
197- S1#^INIT_FROM_METATYPE2_2? check = INIT_FROM_METATYPE2_NOINIT ^#
198- S1( #^INIT_FROM_METATYPE2_3 ? check = INIT_FROM_METATYPE2_NOINIT ^#
199- S2 . #^INIT_FROM_METATYPE2_4? check = INIT_FROM_METATYPE2_SHOW_INIT ^#
200- S2 #^INIT_FROM_METATYPE2_5 ? check = INIT_FROM_METATYPE2_SHOW_INIT ^#
201- S2 ( #^INIT_FROM_METATYPE2_6 ? check = INIT_FROM_METATYPE2_NOINIT ^#
249+ S1. #^INIT_FROM_METATYPE2_1^#
250+ S1#^INIT_FROM_METATYPE2_2^#
251+ S1( #^INIT_FROM_METATYPE2_3 ^#
252+ S2 . #^INIT_FROM_METATYPE2_4^#
253+ S2 #^INIT_FROM_METATYPE2_5 ^#
254+ S2 ( #^INIT_FROM_METATYPE2_6 ^#
202255}
203256// INIT_FROM_METATYPE2_NOINIT-NOT: Decl[Constructor]
204257
@@ -248,7 +301,8 @@ func testHaveRParen2() {
248301}
249302
250303func testHaveComma1( ) {
251- ExplicitConstructors1( #^HAVE_COMMA_1 ? check= EXPLICIT_CONSTRUCTORS_1P^#,
304+ ExplicitConstructors1( #^HAVE_COMMA_1 ^#,
305+ // HAVE_COMMA_1-NOT: Decl[Constructor]
252306}
253307
254308//===--- Test that we show default constuctors inherited from protocols
@@ -261,9 +315,9 @@ class ConformsToProtDefaultInit: ProtDefaultInit {
261315}
262316
263317func testHasDefaultInitFromProtocol( ) {
264- ConformsToProtDefaultInit#^DEFAULT_INIT_FROM_PROT_NODOT? check = DEFAULT_INIT_FROM_PROT ^#
265- ConformsToProtDefaultInit. #^DEFAULT_INIT_FROM_PROT_DOT? check = DEFAULT_INIT_FROM_PROT ^#
266- ConformsToProtDefaultInit( #^DEFAULT_INIT_FROM_PROT_PAREN? check = DEFAULT_INIT_FROM_PROT ^#
318+ ConformsToProtDefaultInit#^DEFAULT_INIT_FROM_PROT_NODOT^#
319+ ConformsToProtDefaultInit. #^DEFAULT_INIT_FROM_PROT_DOT^#
320+ ConformsToProtDefaultInit( #^DEFAULT_INIT_FROM_PROT_PAREN^#
267321
268322// DEFAULT_INIT_FROM_PROT-DAG: Decl[Constructor]/CurrNominal: {{.+}}{#bar: Int#}
269323// DEFAULT_INIT_FROM_PROT-DAG: Decl[Constructor]/Super: {{.+}}{#foo: Int#}
@@ -286,13 +340,13 @@ struct ClosureInInit1 {
286340 }
287341// CLOSURE_IN_INIT_1: Decl[Constructor]/CurrNominal{{(/TypeRelation\[Identical\])?}}: ['(']{#Int#}[')'][#S#];
288342 var prop2 : S = {
289- return S ( #^CLOSURE_IN_INIT_2 ? check = CLOSURE_IN_INIT_1 ^#
343+ return S( #^CLOSURE_IN_INIT_2 ^#
290344 } ( )
291345 var prop3 : S = {
292- S( #^CLOSURE_IN_INIT_3 ? check = CLOSURE_IN_INIT_1 ^#
346+ S( #^CLOSURE_IN_INIT_3 ^#
293347 }
294348 var prop3 : S = {
295- S ( #^CLOSURE_IN_INIT_4 ? check = CLOSURE_IN_INIT_1 ^#
349+ S( #^CLOSURE_IN_INIT_4 ^#
296350 } ( )
297351}
298352
@@ -317,7 +371,7 @@ func testAvailable() {
317371// AVAILABLE_1-DAG: Decl[Constructor]/CurrNominal: ['(']{#normal2: Int#}[')'][#AvailableTest#]; name=normal2: Int
318372// AVAILABLE_1: End completions
319373
320- let _ = AvailableTest . init( #^AVAILABLE_2 ? check = AVAILABLE_1 ^#
374+ let _ = AvailableTest . init( #^AVAILABLE_2 ^#
321375}
322376
323377protocol DataType {
@@ -329,11 +383,6 @@ class DependentTypeInClosure<Data: DataType> {
329383}
330384func testDependentTypeInClosure( ) {
331385 let _: DependentTypeInClosure = . #^DEPENDENT_IN_CLOSURE_3 ^#
332- // DEPENDENT_IN_CLOSURE_3: Begin completions, 2 items
333- // DEPENDENT_IN_CLOSURE_3-DAG: Decl[Constructor]/CurrNominal/TypeRelation[Identical]: init({#(arg): DataType#}, {#fn: (Data.Content) -> Void##(Data.Content) -> Void#})[#DependentTypeInClosure<DataType>#];
334- // DEPENDENT_IN_CLOSURE_3-DAG: Decl[Constructor]/CurrNominal/TypeRelation[Identical]: init({#arg: DataType#}, {#fn: () -> Data.Content##() -> Data.Content#})[#DependentTypeInClosure<DataType>#];
335- // DEPENDENT_IN_CLOSURE_3: End completions
336-
337386 let _ = DependentTypeInClosure ( #^DEPENDENT_IN_CLOSURE_1 ^#)
338387// DEPENDENT_IN_CLOSURE_1: Begin completions
339388// DEPENDENT_IN_CLOSURE_1-DAG: Decl[Constructor]/CurrNominal: ['(']{#(arg): _#}, {#fn: (_.Content) -> Void##(_.Content) -> Void#}[')'][#DependentTypeInClosure<_>#];
0 commit comments