@@ -172,7 +172,7 @@ class SelectionRangeSuite extends BaseSelectionRangeSuite:
172
172
""" |object Main extends App {
173
173
| def x = 12 * (34 + 5@@6)
174
174
|}""" .stripMargin,
175
- List [ String ] (
175
+ List (
176
176
""" |object Main extends App {
177
177
| def x = 12 * (34 + >>region>>56<<region<<)
178
178
|}""" .stripMargin,
@@ -187,3 +187,68 @@ class SelectionRangeSuite extends BaseSelectionRangeSuite:
187
187
|}""" .stripMargin
188
188
)
189
189
)
190
+
191
+ @ Test def `function` =
192
+ check(
193
+ " val hello = (aaa: Int, bb@@b: Int, ccc: Int) => ???" ,
194
+ List (
195
+ " val hello = (aaa: Int, >>region>>bbb: Int<<region<<, ccc: Int) => ???" ,
196
+ " val hello = (>>region>>aaa: Int, bbb: Int, ccc: Int<<region<<) => ???" ,
197
+ " val hello = >>region>>(aaa: Int, bbb: Int, ccc: Int) => ???<<region<<" ,
198
+ " >>region>>val hello = (aaa: Int, bbb: Int, ccc: Int) => ???<<region<<" ,
199
+ )
200
+ )
201
+
202
+ @ Test def `defdef` =
203
+ check(
204
+ " def hello(aaa: Int, bb@@b: Int, ccc: Int) = ???" ,
205
+ List (
206
+ " def hello(aaa: Int, >>region>>bbb: Int<<region<<, ccc: Int) = ???" ,
207
+ " def hello(>>region>>aaa: Int, bbb: Int, ccc: Int<<region<<) = ???" ,
208
+ " >>region>>def hello(aaa: Int, bbb: Int, ccc: Int) = ???<<region<<" ,
209
+ )
210
+ )
211
+
212
+ @ Test def `apply` =
213
+ check(
214
+ " def hello = List(111, 2@@22, 333)" ,
215
+ List (
216
+ " def hello = List(111, >>region>>222<<region<<, 333)" ,
217
+ " def hello = List(>>region>>111, 222, 333<<region<<)" ,
218
+ " def hello = >>region>>List(111, 222, 333)<<region<<" ,
219
+ " >>region>>def hello = List(111, 222, 333)<<region<<" ,
220
+ )
221
+ )
222
+
223
+ @ Test def `type-apply` =
224
+ check(
225
+ " def hello = Map[String, I@@nt]()" ,
226
+ List (
227
+ " def hello = Map[String, >>region>>Int<<region<<]()" ,
228
+ " def hello = Map[>>region>>String, Int<<region<<]()" ,
229
+ " def hello = >>region>>Map[String, Int]<<region<<()" ,
230
+ " def hello = >>region>>Map[String, Int]()<<region<<" ,
231
+ " >>region>>def hello = Map[String, Int]()<<region<<" ,
232
+ )
233
+ )
234
+
235
+ @ Test def `unapply` =
236
+ check(
237
+ " val List(aaa, b@@bb, ccc) = List(111, 222, 333)" ,
238
+ List (
239
+ " val List(aaa, >>region>>bbb<<region<<, ccc) = List(111, 222, 333)" ,
240
+ " val List(>>region>>aaa, bbb, ccc<<region<<) = List(111, 222, 333)" ,
241
+ " val >>region>>List(aaa, bbb, ccc)<<region<< = List(111, 222, 333)" ,
242
+ " >>region>>val List(aaa, bbb, ccc) = List(111, 222, 333)<<region<<" ,
243
+ )
244
+ )
245
+
246
+ @ Test def `single` =
247
+ check(
248
+ " def hello = List(2@@22)" ,
249
+ List (
250
+ " def hello = List(>>region>>222<<region<<)" ,
251
+ " def hello = >>region>>List(222)<<region<<" ,
252
+ " >>region>>def hello = List(222)<<region<<" ,
253
+ )
254
+ )
0 commit comments