diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala index c962543192d..78d668ec4b8 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala @@ -51,7 +51,7 @@ case class ScalaPresentationCompiler( val scalaVersion = BuildInfo.scalaCompilerVersion private val forbiddenOptions = Set("-print-lines", "-print-tasty") - private val forbiddenDoubleOptions = Set("-release") + private val forbiddenDoubleOptions = Set.empty[String] given ReportContext = folderPath .map(StdReportContext(_, _ => buildTargetName, reportsLevel)) diff --git a/tests/cross/src/test/scala/tests/pc/Release11CompletionSuite.scala b/tests/cross/src/test/scala/tests/pc/Release11CompletionSuite.scala new file mode 100644 index 00000000000..ce3a2c4bd4b --- /dev/null +++ b/tests/cross/src/test/scala/tests/pc/Release11CompletionSuite.scala @@ -0,0 +1,71 @@ +package tests.pc + +import tests.BaseCompletionSuite +import java.nio.file.Path + +class Release11CompletionSuite extends BaseCompletionSuite { + + override protected def ignoreScalaVersion: Option[IgnoreScalaVersion] = Some( + IgnoreScala211 + ) + + override protected def scalacOptions(classpath: Seq[Path]): Seq[String] = Seq( + "-release", + "11" + ) + + check( + "keyword", + """|object Main { + | "M".rep@@ + |} + |""".stripMargin, + // repeat method was added in JDK 11 + """|repeat(x$1: Int): String + |replace(x$1: Char, x$2: Char): String + |replace(x$1: CharSequence, x$2: CharSequence): String + |replaceAll(x$1: String, x$2: String): String + |replaceFirst(x$1: String, x$2: String): String + |prepended(c: Char): String + |prepended[B >: Char](elem: B): IndexedSeq[B] + |prependedAll(prefix: String): String + |prependedAll[B >: Char](prefix: IterableOnce[B]): IndexedSeq[B] + |charStepper: IntStepper with Stepper.EfficientSplit + |corresponds[B](that: IterableOnce[B])(p: (Char, B) => Boolean): Boolean + |corresponds[B](that: Seq[B])(p: (Char, B) => Boolean): Boolean + |reduceLeftOption[B >: Char](op: (B, Char) => B): Option[B] + |reduceOption[B >: Char](op: (B, B) => B): Option[B] + |reduceRightOption[B >: Char](op: (Char, B) => B): Option[B] + |replaceAllLiterally(literal: String, replacement: String): String + |repr: WrappedString + |reverseMap[B](f: Char => B): IndexedSeq[B] + |""".stripMargin, + compat = Map( + "3" -> + """|repeat(x$0: Int): String + |replace(x$0: CharSequence, x$1: CharSequence): String + |replace(x$0: Char, x$1: Char): String + |replaceAll(x$0: String, x$1: String): String + |replaceFirst(x$0: String, x$1: String): String + |replaceAllLiterally(literal: String, replacement: String): String + |repr: C + |""".stripMargin, + "2.12" -> + """|repeat(x$1: Int): String + |replace(x$1: Char, x$2: Char): String + |replace(x$1: CharSequence, x$2: CharSequence): String + |replaceAll(x$1: String, x$2: String): String + |replaceFirst(x$1: String, x$2: String): String + |repr: String + |replaceAllLiterally(literal: String, replacement: String): String + |repr: WrappedString + |corresponds[B](that: GenSeq[B])(p: (Char, B) => Boolean): Boolean + |reduceLeftOption[B >: Char](op: (B, Char) => B): Option[B] + |reduceOption[A1 >: Char](op: (A1, A1) => A1): Option[A1] + |reduceRightOption[B >: Char](op: (Char, B) => B): Option[B] + |reverseMap[B, That](f: Char => B)(implicit bf: CanBuildFrom[String,B,That]): That + |""".stripMargin + ) + ) + +} diff --git a/tests/cross/src/test/scala/tests/pc/Release8CompletionSuite.scala b/tests/cross/src/test/scala/tests/pc/Release8CompletionSuite.scala new file mode 100644 index 00000000000..12ecc821a58 --- /dev/null +++ b/tests/cross/src/test/scala/tests/pc/Release8CompletionSuite.scala @@ -0,0 +1,67 @@ +package tests.pc + +import tests.BaseCompletionSuite +import java.nio.file.Path + +class Release8CompletionSuite extends BaseCompletionSuite { + + override protected def ignoreScalaVersion: Option[IgnoreScalaVersion] = Some( + IgnoreScala211 + ) + + override protected def scalacOptions(classpath: Seq[Path]): Seq[String] = Seq( + "-release", + "8" + ) + + check( + "keyword", + """|object Main { + | "M".rep@@ + |} + |""".stripMargin, + """|replace(x$1: Char, x$2: Char): String + |replace(x$1: CharSequence, x$2: CharSequence): String + |replaceAll(x$1: String, x$2: String): String + |replaceFirst(x$1: String, x$2: String): String + |prepended(c: Char): String + |prepended[B >: Char](elem: B): IndexedSeq[B] + |prependedAll(prefix: String): String + |prependedAll[B >: Char](prefix: IterableOnce[B]): IndexedSeq[B] + |charStepper: IntStepper with Stepper.EfficientSplit + |corresponds[B](that: IterableOnce[B])(p: (Char, B) => Boolean): Boolean + |corresponds[B](that: Seq[B])(p: (Char, B) => Boolean): Boolean + |reduceLeftOption[B >: Char](op: (B, Char) => B): Option[B] + |reduceOption[B >: Char](op: (B, B) => B): Option[B] + |reduceRightOption[B >: Char](op: (Char, B) => B): Option[B] + |replaceAllLiterally(literal: String, replacement: String): String + |repr: WrappedString + |reverseMap[B](f: Char => B): IndexedSeq[B] + |""".stripMargin, + compat = Map( + "3" -> + """|replace(x$0: CharSequence, x$1: CharSequence): String + |replace(x$0: Char, x$1: Char): String + |replaceAll(x$0: String, x$1: String): String + |replaceFirst(x$0: String, x$1: String): String + |replaceAllLiterally(literal: String, replacement: String): String + |repr: C + |""".stripMargin, + "2.12" -> + """|replace(x$1: Char, x$2: Char): String + |replace(x$1: CharSequence, x$2: CharSequence): String + |replaceAll(x$1: String, x$2: String): String + |replaceFirst(x$1: String, x$2: String): String + |repr: String + |replaceAllLiterally(literal: String, replacement: String): String + |repr: WrappedString + |corresponds[B](that: GenSeq[B])(p: (Char, B) => Boolean): Boolean + |reduceLeftOption[B >: Char](op: (B, Char) => B): Option[B] + |reduceOption[A1 >: Char](op: (A1, A1) => A1): Option[A1] + |reduceRightOption[B >: Char](op: (Char, B) => B): Option[B] + |reverseMap[B, That](f: Char => B)(implicit bf: CanBuildFrom[String,B,That]): That + |""".stripMargin + ) + ) + +}