File tree 2 files changed +35
-0
lines changed
src/main/dotty/tools/pc/completions
test/dotty/tools/pc/tests/completion
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -65,6 +65,10 @@ class Completions(
65
65
*/
66
66
case (fun) :: (appl : GenericApply ) :: _ if appl.fun == fun =>
67
67
false
68
+ /* In case of `T@@[]` we should not add snippets.
69
+ */
70
+ case tpe :: (appl : AppliedTypeTree ) :: _ if appl.tpt == tpe =>
71
+ false
68
72
case _ :: (withcursor @ Select (fun, name)) :: (appl : GenericApply ) :: _
69
73
if appl.fun == withcursor && name.decoded == Cursor .value =>
70
74
false
Original file line number Diff line number Diff line change @@ -451,3 +451,34 @@ class CompletionSnippetSuite extends BaseCompletionSuite:
451
451
""" .stripMargin,
452
452
filter = _.contains(" bar: Int" )
453
453
)
454
+
455
+ @ Test def `brackets-already-present` =
456
+ check(
457
+ """ |package a
458
+ |case class AAA[T]()
459
+ |object O {
460
+ | val l: AA@@[Int] = ???
461
+ |}
462
+ |""" .stripMargin,
463
+ """ |AAA a
464
+ |ArrowAssoc scala.Predef
465
+ |""" .stripMargin,
466
+ )
467
+
468
+ @ Test def `brackets-already-present-edit` =
469
+ checkEdit(
470
+ """ |package a
471
+ |case class AAA[T]()
472
+ |object O {
473
+ | val l: AA@@[Int] = ???
474
+ |}
475
+ |""" .stripMargin,
476
+ """ |package a
477
+ |case class AAA[T]()
478
+ |object O {
479
+ | val l: AAA[Int] = ???
480
+ |}
481
+ |""" .stripMargin,
482
+ assertSingleItem = false ,
483
+ )
484
+
You can’t perform that action at this time.
0 commit comments