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