|
3 | 3 | // it's enabled. When a feature becomes non-experimental, move its test cases
|
4 | 4 | // into the normal complete_decl_attribute.swift test file.
|
5 | 5 |
|
6 |
| -// NOTE: There are currently no experimental features that need code completion |
7 |
| -// testing, but this test file is being left in place for when it's needed |
8 |
| -// again. At that time, please remove the ABIAttribute tests. |
9 |
| -// REQUIRES: new_use_case |
10 |
| - |
11 | 6 | // REQUIRES: asserts
|
12 | 7 |
|
13 | 8 | // RUN: %batch-code-completion -filecheck-additional-suffix _DISABLED
|
14 | 9 | // RUN: %batch-code-completion -filecheck-additional-suffix _ENABLED \
|
15 |
| -// RUN: -enable-experimental-feature ABIAttribute \ |
16 |
| -// RUN: -enable-experimental-feature ExtensibleAttribute |
| 10 | +// RUN: -enable-experimental-feature NonexhaustiveAttribute |
17 | 11 |
|
18 | 12 | // NOTE: Please do not include the ", N items" after "Begin completions". The
|
19 | 13 | // item count creates needless merge conflicts given that an "End completions"
|
20 | 14 | // line exists for each test.
|
21 | 15 |
|
22 |
| -@#^KEYWORD2^# func method(){} |
23 |
| - |
24 |
| -// KEYWORD2: Begin completions |
25 |
| -// KEYWORD2_ENABLED-DAG: Keyword/None: abi[#Func Attribute#]; name=abi |
26 |
| -// KEYWORD2_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
27 |
| -// KEYWORD2: End completions |
28 |
| - |
29 |
| -@#^KEYWORD3^# class C {} |
30 |
| - |
31 |
| -// KEYWORD3: Begin completions |
32 |
| -// KEYWORD3_ENABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
33 |
| -// KEYWORD3_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
34 |
| -// KEYWORD3: End completions |
35 |
| - |
36 |
| -@#^KEYWORD3_2?check=KEYWORD3^#IB class C2 {} |
37 |
| -// Same as KEYWORD3. |
38 |
| - |
39 | 16 | @#^KEYWORD4^# enum E {}
|
40 | 17 | // KEYWORD4: Begin completions
|
41 |
| -// KEYWORD4_ENABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
42 |
| -// KEYWORD4_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
43 |
| -// KEYWORD4_ENABLED-DAG: Keyword/None: extensible[#{{.*}} Attribute#]; name=extensible |
44 |
| -// KEYWORD4_DISABLED-NOT: Keyword/None: extensible[#{{.*}} Attribute#]; name=extensible |
| 18 | +// KEYWORD4_ENABLED-DAG: Keyword/None: nonexhaustive[#{{.*}} Attribute#]; name=nonexhaustive |
| 19 | +// KEYWORD4_DISABLED-NOT: Keyword/None: nonexhaustive[#{{.*}} Attribute#]; name=nonexhaustive |
45 | 20 | // KEYWORD4: End completions
|
46 |
| - |
47 |
| -@#^KEYWORD5^# struct S{} |
48 |
| -// KEYWORD5: Begin completions |
49 |
| -// KEYWORD5_ENABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
50 |
| -// KEYWORD5_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
51 |
| -// KEYWORD5: End completions |
52 |
| - |
53 |
| -@#^ON_GLOBALVAR^# var globalVar |
54 |
| -// ON_GLOBALVAR: Begin completions |
55 |
| -// ON_GLOBALVAR_ENABLED-DAG: Keyword/None: abi[#Var Attribute#]; name=abi |
56 |
| -// ON_GLOBALVAR_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
57 |
| -// ON_GLOBALVAR: End completions |
58 |
| - |
59 |
| -struct _S { |
60 |
| - @#^ON_INIT^# init() |
61 |
| -// ON_INIT: Begin completions |
62 |
| -// ON_INIT_ENABLED-DAG: Keyword/None: abi[#Constructor Attribute#]; name=abi |
63 |
| -// ON_INIT_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
64 |
| -// ON_INIT: End completions |
65 |
| - |
66 |
| - @#^ON_PROPERTY^# var foo |
67 |
| -// ON_PROPERTY: Begin completions |
68 |
| -// ON_PROPERTY_ENABLED-DAG: Keyword/None: abi[#Var Attribute#]; name=abi |
69 |
| -// ON_PROPERTY_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
70 |
| -// ON_PROPERTY: End completions |
71 |
| - |
72 |
| - @#^ON_SUBSCR^# subscript |
73 |
| -// ON_SUBSCR: Begin completions |
74 |
| -// ON_SUBSCR_ENABLED-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi |
75 |
| -// ON_SUBSCR_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
76 |
| -// ON_SUBSCR: End completions |
77 |
| - |
78 |
| - @#^ON_METHOD^# private |
79 |
| - func foo() |
80 |
| -// ON_METHOD: Begin completions |
81 |
| -// ON_METHOD_ENABLED-DAG: Keyword/None: abi[#Func Attribute#]; name=abi |
82 |
| -// ON_METHOD_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
83 |
| -// ON_METHOD: End completions |
84 |
| - |
85 |
| - |
86 |
| - func bar(@#^ON_PARAM_1?check=ON_PARAM^#) |
87 |
| -// ON_PARAM: Begin completions |
88 |
| -// ON_PARAM_ENABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
89 |
| -// ON_PARAM_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
90 |
| -// ON_PARAM: End completions |
91 |
| - |
92 |
| - func bar( |
93 |
| - @#^ON_PARAM_2?check=ON_PARAM^# |
94 |
| - |
95 |
| - arg: Int |
96 |
| - ) |
97 |
| -// Same as ON_PARAM. |
98 |
| - |
99 |
| - @#^ON_MEMBER_INDEPENDENT_1?check=ON_MEMBER_LAST^# |
100 |
| - |
101 |
| - func dummy1() {} |
102 |
| -// Same as ON_MEMBER_LAST. |
103 |
| - |
104 |
| - @#^ON_MEMBER_INDEPENDENT_2?check=ON_MEMBER_LAST^# |
105 |
| - func dummy2() {} |
106 |
| -// Same as ON_MEMBER_LAST. |
107 |
| - |
108 |
| - |
109 |
| - @#^ON_MEMBER_LAST^# |
110 |
| -// ON_MEMBER_LAST: Begin completions |
111 |
| -// ON_MEMBER_LAST_ENABLED-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi |
112 |
| -// ON_MEMBER_LAST_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
113 |
| -// ON_MEMBER_LAST: End completions |
114 |
| -} |
115 |
| - |
116 |
| -func takeClosure(_: () -> Void) { |
117 |
| - takeClosure { @#^IN_CLOSURE^# in |
118 |
| - print("x") |
119 |
| - } |
120 |
| -} |
121 |
| -// IN_CLOSURE: Begin completions |
122 |
| -// FIXME: Not valid in this position (but CompletionLookup can't tell that) |
123 |
| -// IN_CLOSURE_ENABLED-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi |
124 |
| -// IN_CLOSURE_DISABLED-NOT: Keyword/None: abi[#{{.*}} Attribute#]; name=abi |
125 |
| -// IN_CLOSURE: End completions |
126 |
| - |
127 |
| -@#^KEYWORD_INDEPENDENT_1?check=KEYWORD_LAST^# |
128 |
| - |
129 |
| -func dummy1() {} |
130 |
| -// Same as KEYWORD_LAST. |
131 |
| - |
132 |
| -@#^KEYWORD_INDEPENDENT_2?check=KEYWORD_LAST^# |
133 |
| -func dummy2() {} |
134 |
| -// Same as KEYWORD_LAST. |
135 |
| - |
136 |
| -@#^KEYWORD_LAST^# |
137 |
| - |
138 |
| -// KEYWORD_LAST: Begin completions |
139 |
| -// KEYWORD_LAST_ENABLED-DAG: Keyword/None: abi[#Declaration Attribute#]; name=abi |
140 |
| -// KEYWORD_LAST_DISABLED-NOT: Keyword/None: abi[#Declaration Attribute#]; name=abi |
141 |
| -// KEYWORD_LAST: End completions |
0 commit comments