|
3 | 3 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GP3 | %FileCheck %s -check-prefix=A1
|
4 | 4 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GP4 | %FileCheck %s -check-prefix=TYPE1
|
5 | 5 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GP5 | %FileCheck %s -check-prefix=TYPE1
|
6 |
| -// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GP6 | %FileCheck %s -check-prefix=A1 |
| 6 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=GP6 | %FileCheck %s -check-prefix=EMPTY |
7 | 7 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=FUNC_ASSOC_NODUP_1 | %FileCheck %s -check-prefix=GEN_T_ASSOC_E
|
8 | 8 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=FUNC_ASSOC_NODUP_2 | %FileCheck %s -check-prefix=GEN_T_ASSOC_E
|
9 | 9 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=FUNC_1 | %FileCheck %s -check-prefix=GEN_T
|
|
21 | 21 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ALIAS_2 | %FileCheck %s -check-prefix=GEN_T_DOT
|
22 | 22 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_1 | %FileCheck %s -check-prefix=GEN_T_NOMINAL
|
23 | 23 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_2 | %FileCheck %s -check-prefix=GEN_T_DOT
|
24 |
| -// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_3 | %FileCheck %s -check-prefix=GEN_T_NOMINAL |
| 24 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_3 | %FileCheck %s -check-prefix=ANYTYPE |
25 | 25 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=STRUCT_4 | %FileCheck %s -check-prefix=GEN_T_DOT
|
26 | 26 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLASS_1 | %FileCheck %s -check-prefix=GEN_T_NOMINAL
|
27 | 27 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=CLASS_2 | %FileCheck %s -check-prefix=GEN_T_DOT
|
28 | 28 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ENUM_1 | %FileCheck %s -check-prefix=GEN_T_NOMINAL
|
29 | 29 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ENUM_2 | %FileCheck %s -check-prefix=GEN_T_DOT
|
30 | 30 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ASSOC_1 | %FileCheck %s -check-prefix=P2
|
31 | 31 | // RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ASSOC_2 | %FileCheck %s -check-prefix=U_DOT
|
| 32 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PROTOCOL | %FileCheck %s -check-prefix=PROTOCOL |
| 33 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PROTOCOL_EXT | %FileCheck %s -check-prefix=PROTOCOL |
| 34 | +// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=PROTOCOL_SELF | %FileCheck %s -check-prefix=PROTOCOL_SELF |
32 | 35 |
|
33 | 36 | class A1<T1, T2, T3> {}
|
34 | 37 |
|
@@ -65,6 +68,10 @@ extension A1 where T1.#^GP6^# {}
|
65 | 68 | // TYPE1-NOT: T4
|
66 | 69 | // TYPE1-NOT: T5
|
67 | 70 |
|
| 71 | +// EMPTY: Begin completions, 1 items |
| 72 | +// EMPTY-DAG: Keyword/None: Type[#T1.Type#]; name=Type |
| 73 | +// EMPTY: End completions |
| 74 | + |
68 | 75 | protocol A {associatedtype E}
|
69 | 76 | protocol B {associatedtype E}
|
70 | 77 |
|
@@ -118,20 +125,55 @@ class C1<T> where #^CLASS_1^# {}
|
118 | 125 | class C2<T> where T.#^CLASS_2^# {}
|
119 | 126 | enum E1<T> where #^ENUM_1^# {}
|
120 | 127 | enum E2<T> where T.#^ENUM_2^# {}
|
| 128 | +// GEN_T_NOMINAL: Begin completions, 1 items |
121 | 129 | // GEN_T_NOMINAL: Decl[GenericTypeParam]/Local: T[#T#]; name=T
|
| 130 | +// GEN_T_NOMINAL: End completions |
| 131 | + |
| 132 | +// ANYTYPE: Begin completions |
| 133 | +// ANYTYPE-DAG: Decl[GenericTypeParam]/Local: T[#T#]; |
| 134 | +// ANYTYPE-DAG: Decl[Class]/CurrModule: A1[#A1#]; |
| 135 | +// ANYTYPE-DAG: Decl[Struct]/OtherModule[Swift]: Int[#Int#]; |
| 136 | +// ANYTYPE: End completions |
122 | 137 |
|
123 | 138 | protocol P2 {
|
124 | 139 | associatedtype T where #^ASSOC_1^#
|
125 | 140 | associatedtype U: Assoc where U.#^ASSOC_2^#
|
126 | 141 | }
|
127 | 142 |
|
128 |
| -// P2: Begin completions |
| 143 | +// P2: Begin completions, 3 items |
129 | 144 | // P2-DAG: Decl[GenericTypeParam]/Local: Self[#Self#];
|
130 | 145 | // P2-DAG: Decl[AssociatedType]/{{Super|CurrNominal}}: T;
|
131 | 146 | // P2-DAG: Decl[AssociatedType]/{{Super|CurrNominal}}: U;
|
132 | 147 | // P2: End completions
|
133 | 148 |
|
134 |
| -// U_DOT: Begin completions |
135 |
| -// FIXME: Should complete Q from Assoc. |
| 149 | +// U_DOT: Begin completions, 2 items |
136 | 150 | // U_DOT-DAG: Keyword/None: Type[#Self.U.Type#];
|
| 151 | +// U_DOT-DAG: Decl[AssociatedType]/CurrNominal: Q; |
137 | 152 | // U_DOT: End completions
|
| 153 | + |
| 154 | +protocol P3 where #^PROTOCOL^# { |
| 155 | + associatedtype T: Assoc |
| 156 | + typealias U = T.Q |
| 157 | + typealias IntAlias = Int |
| 158 | +} |
| 159 | +// PROTOCOL: Begin completions, 3 items |
| 160 | +// PROTOCOL-DAG: Decl[GenericTypeParam]/Local: Self[#Self#]; |
| 161 | +// PROTOCOL-DAG: Decl[AssociatedType]/CurrNominal: T; |
| 162 | +// PROTOCOL-DAG: Decl[TypeAlias]/CurrNominal: U[#Self.T.Q#]; |
| 163 | +// PROTOCOL: End completions |
| 164 | + |
| 165 | +extension P3 where #^PROTOCOL_EXT^# { |
| 166 | + // Same as PROTOCOL |
| 167 | +} |
| 168 | + |
| 169 | +protocol P4 where Self.#^PROTOCOL_SELF^# { |
| 170 | + associatedtype T: Assoc |
| 171 | + typealias U = T.Q |
| 172 | + typealias IntAlias = Int |
| 173 | +} |
| 174 | +// PROTOCOL_SELF: Begin completions, 4 items |
| 175 | +// PROTOCOL_SELF-DAG: Decl[AssociatedType]/CurrNominal: T; |
| 176 | +// PROTOCOL_SELF-DAG: Decl[TypeAlias]/CurrNominal: U[#Self.T.Q#]; |
| 177 | +// PROTOCOL_SELF-DAG: Decl[TypeAlias]/CurrNominal: IntAlias[#Int#]; |
| 178 | +// PROTOCOL_SELF-DAG: Keyword/None: Type[#Self.Type#]; |
| 179 | +// PROTOCOL_SELF: End completions |
0 commit comments