Skip to content

Commit

Permalink
Add support for Scala 3.1.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Sep 3, 2021
1 parent 9668813 commit 2e14a46
Show file tree
Hide file tree
Showing 14 changed files with 144 additions and 126 deletions.
1 change: 1 addition & 0 deletions bin/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ suffix=${argumentsRest:-}
coursier fetch \
org.scalameta:mtags_3.0.0:$version \
org.scalameta:mtags_3.0.1:$version \
org.scalameta:mtags_3.0.2:$version \
org.scalameta:metals_2.12:$version \
org.scalameta:mtags_2.13.0:$version \
org.scalameta:mtags_2.13.1:$version \
Expand Down
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ lazy val V = new {
val bsp = "2.0.0-M13"
val bloop = "1.4.8-114-e47368ed"
val scala3 = "3.0.2"
val nextScala3RC = "3.1.0-RC1"
val bloopNightly = bloop
val sbtBloop = bloop
val gradleBloop = bloop
Expand Down Expand Up @@ -242,7 +243,7 @@ lazy val V = new {
def scala2Versions = nonDeprecatedScala2Versions ++ deprecatedScala2Versions

// Scala 3
def nonDeprecatedScala3Versions = Seq(scala3, "3.0.1", "3.0.0")
def nonDeprecatedScala3Versions = Seq(nextScala3RC, scala3, "3.0.1", "3.0.0")
def deprecatedScala3Versions = Seq()
def scala3Versions = nonDeprecatedScala3Versions ++ deprecatedScala3Versions

Expand Down
14 changes: 7 additions & 7 deletions tests/cross/src/test/scala/tests/hover/HoverDefnSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class HoverDefnSuite extends BaseHoverSuite {
|```
|""".stripMargin,
compat = Map(
"3.0" -> "def <init>(x: Int): a".hover
"3" -> "def <init>(x: Int): a".hover
)
)

Expand Down Expand Up @@ -147,7 +147,7 @@ class HoverDefnSuite extends BaseHoverSuite {
|""".stripMargin,
"",
compat = Map(
"3.0" -> "object MyObject: `object`".hover
"3" -> "object MyObject: `object`".hover
)
)

Expand All @@ -157,7 +157,7 @@ class HoverDefnSuite extends BaseHoverSuite {
|""".stripMargin,
"",
compat = Map(
"3.0" -> "trait MyTrait: MyTrait".hover
"3" -> "trait MyTrait: MyTrait".hover
)
)

Expand All @@ -167,7 +167,7 @@ class HoverDefnSuite extends BaseHoverSuite {
|""".stripMargin,
"",
compat = Map(
"3.0" -> "trait MyClass: MyClass".hover
"3" -> "trait MyClass: MyClass".hover
)
)

Expand All @@ -183,7 +183,7 @@ class HoverDefnSuite extends BaseHoverSuite {
automaticPackage = false,
compat = Map(
// TODO hover doesn't show information on package
"3.0" -> "".hover
"3" -> "".hover
)
)

Expand All @@ -198,7 +198,7 @@ class HoverDefnSuite extends BaseHoverSuite {
|""".stripMargin,
"head: Int".hover,
compat = Map(
"3.0" -> "val head: Int".hover
"3" -> "val head: Int".hover
)
)

Expand All @@ -213,7 +213,7 @@ class HoverDefnSuite extends BaseHoverSuite {
|""".stripMargin,
"value: Int".hover,
compat = Map(
"3.0" -> "val value: Int".hover
"3" -> "val value: Int".hover
)
)

Expand Down
2 changes: 1 addition & 1 deletion tests/cross/src/test/scala/tests/hover/HoverDocSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class HoverDocSuite extends BaseHoverSuite {
|List<String> s = Collections.emptyList();
|```
|""".stripMargin,
"3.0" -> "def emptyList[T]: java.util.List[T]".hover
"3" -> "def emptyList[T]: java.util.List[T]".hover
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class HoverNamedArgSuite extends BaseHoverSuite {
|- `named`: the argument
|""".stripMargin,
compat = Map(
"3.0" -> "named: Int".hover
"3" -> "named: Int".hover
)
)

Expand All @@ -50,7 +50,7 @@ class HoverNamedArgSuite extends BaseHoverSuite {
|""".stripMargin,
"",
compat = Map(
"3.0" -> "named: Int".hover
"3" -> "named: Int".hover
)
)

Expand All @@ -64,7 +64,7 @@ class HoverNamedArgSuite extends BaseHoverSuite {
|""".stripMargin,
"def this(name: String, age: Int): User".hover,
compat = Map(
"3.0" -> "name: String".hover
"3" -> "name: String".hover
)
)

Expand Down
42 changes: 21 additions & 21 deletions tests/cross/src/test/scala/tests/hover/HoverTermSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class HoverTermSuite extends BaseHoverSuite {
|final override def map[B, That](f: Int => B)(implicit bf: CanBuildFrom[List[Int],B,That]): That
|""".stripMargin.hover,
compat = Map(
"3.0" -> "def map[B](f: A => B): List[B]".hover
"3" -> "def map[B](f: A => B): List[B]".hover
)
)

Expand All @@ -24,7 +24,7 @@ class HoverTermSuite extends BaseHoverSuite {
|""".stripMargin,
"abstract trait App: App".hover,
compat = Map(
"3.0" -> "trait App: App".hover
"3" -> "trait App: App".hover
)
)

Expand All @@ -42,7 +42,7 @@ class HoverTermSuite extends BaseHoverSuite {
"""|List[Int]
|def apply[A](elems: A*): List[A]
|""".stripMargin.hover,
"3.0" -> "def apply[A](elems: A*): Int".hover
"3" -> "def apply[A](elems: A*): Int".hover
)
)

Expand All @@ -56,7 +56,7 @@ class HoverTermSuite extends BaseHoverSuite {
"""|def apply(name: String): Person
|""".stripMargin.hover,
compat = Map(
"3.0" -> "case class Person: `case-apply`".hover
"3" -> "case class Person: `case-apply`".hover
)
)

Expand Down Expand Up @@ -103,7 +103,7 @@ class HoverTermSuite extends BaseHoverSuite {
|def f[A >: Any](args: A*): String = macro
|""".stripMargin.hover,
compat = Map(
"3.0" -> "def f[A >: Any](args: A*): String".hover
"3" -> "def f[A >: Any](args: A*): String".hover
)
)

Expand All @@ -124,7 +124,7 @@ class HoverTermSuite extends BaseHoverSuite {
|def apply[T](a: T)(implicit ev: Int): T
|""".stripMargin.hover,
compat = Map(
"3.0" -> "def apply[T](a: T)(implicit ev: Int): Int".hover
"3" -> "def apply[T](a: T)(implicit ev: Int): Int".hover
)
)

Expand All @@ -147,7 +147,7 @@ class HoverTermSuite extends BaseHoverSuite {
|""".stripMargin.hover,
compat = Map(
// https://github.com/lampepfl/dotty/issues/8835
"3.0" -> "object num: `interpolator-unapply`.a.Xtension".hover
"3" -> "object num: `interpolator-unapply`.a.Xtension".hover
)
)

Expand All @@ -162,7 +162,7 @@ class HoverTermSuite extends BaseHoverSuite {
"""|def this(name: String, age: Int): Foo
|""".stripMargin.hover,
compat = Map(
"3.0" -> "class Foo: Foo".hover
"3" -> "class Foo: Foo".hover
)
)

Expand All @@ -178,7 +178,7 @@ class HoverTermSuite extends BaseHoverSuite {
|def this(name: String, age: T): Foo[T]
|""".stripMargin.hover,
compat = Map(
"3.0" -> "class Foo: Int".hover
"3" -> "class Foo: Int".hover
)
)

Expand All @@ -194,7 +194,7 @@ class HoverTermSuite extends BaseHoverSuite {
|def this(name: String, age: T): Foo[T]
|""".stripMargin.hover,
compat = Map(
"3.0" -> "class Foo: Foo".hover
"3" -> "class Foo: Foo".hover
)
)

Expand All @@ -210,7 +210,7 @@ class HoverTermSuite extends BaseHoverSuite {
|""".stripMargin,
"",
compat = Map(
"3.0" -> "class Foo: Foo".hover
"3" -> "class Foo: Foo".hover
)
)

Expand Down Expand Up @@ -243,7 +243,7 @@ class HoverTermSuite extends BaseHoverSuite {
|def flatMap[B](f: Int => Option[B]): Option[B]
|""".stripMargin.hover,
compat = Map(
"3.0" -> "val <local a$>: (x: Int): Boolean".hover
"3" -> "val <local a$>: (x: Int): Boolean".hover
)
)

Expand All @@ -262,7 +262,7 @@ class HoverTermSuite extends BaseHoverSuite {
|final def map[B](f: Int => B): Option[B]
|""".stripMargin.hover,
compat = Map(
"3.0" -> "val <local a$>: (y: Int): String".hover
"3" -> "val <local a$>: (y: Int): String".hover
)
)

Expand All @@ -281,7 +281,7 @@ class HoverTermSuite extends BaseHoverSuite {
|def flatMap[B](f: Int => Option[B]): Option[B]
|""".stripMargin.hover,
compat = Map(
"3.0" -> "def flatMap[B](f: A => Option[B]): Option[String]".hover
"3" -> "def flatMap[B](f: A => Option[B]): Option[String]".hover
)
)

Expand All @@ -300,7 +300,7 @@ class HoverTermSuite extends BaseHoverSuite {
|final def map[B](f: Long => B): Option[B]
|""".stripMargin.hover,
compat = Map(
"3.0" -> "val <local a$>: (y: Long): String".hover
"3" -> "val <local a$>: (y: Long): String".hover
)
)

Expand All @@ -318,7 +318,7 @@ class HoverTermSuite extends BaseHoverSuite {
"""|final def withFilter(p: Int => Boolean): Option[Int]#WithFilter
|""".stripMargin.hover,
compat = Map(
"3.0" -> "val <local a$>: (x: Int): Boolean".hover
"3" -> "val <local a$>: (x: Int): Boolean".hover
)
)

Expand All @@ -335,7 +335,7 @@ class HoverTermSuite extends BaseHoverSuite {
|```
|""".stripMargin,
compat = Map(
"3.0" -> "enum FileVisitResult: java.nio.file".hover
"3" -> "enum FileVisitResult: java.nio.file".hover
)
)

Expand All @@ -358,7 +358,7 @@ class HoverTermSuite extends BaseHoverSuite {
|""".stripMargin,
automaticPackage = false,
compat = Map(
"3.0" -> "object Foo: app.Outer".hover
"3" -> "object Foo: app.Outer".hover
)
)

Expand Down Expand Up @@ -403,7 +403,7 @@ class HoverTermSuite extends BaseHoverSuite {
"""|class java.nio.file.Files
|""".stripMargin.hover,
compat = Map(
"3.0" -> "object Files: java.nio.file".hover
"3" -> "object Files: java.nio.file".hover
)
)

Expand All @@ -415,7 +415,7 @@ class HoverTermSuite extends BaseHoverSuite {
"""|class java.nio.file.Paths
|""".stripMargin.hover,
compat = Map(
"3.0" -> "object Paths: java.nio.file".hover
"3" -> "object Paths: java.nio.file".hover
)
)

Expand Down Expand Up @@ -456,7 +456,7 @@ class HoverTermSuite extends BaseHoverSuite {
|""".stripMargin,
"""final val CONTINUE: FileVisitResult""".hover,
compat = Map(
"3.0" -> "case CONTINUE: FileVisitResult".hover
"3" -> "case CONTINUE: FileVisitResult".hover
)
)
}
12 changes: 6 additions & 6 deletions tests/cross/src/test/scala/tests/pc/CompletionArgSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class CompletionArgSuite extends BaseCompletionSuite {
|""".stripMargin,
topLines = Option(4),
compat = Map(
"3.0" ->
"3" ->
"""|age = : Int
|followers = : Int
|Main arg5
Expand Down Expand Up @@ -150,7 +150,7 @@ class CompletionArgSuite extends BaseCompletionSuite {
|""".stripMargin,
topLines = Option(2),
compat = Map(
"3.0" ->
"3" ->
"""|x = : A
|Main arg7
|""".stripMargin
Expand Down Expand Up @@ -245,7 +245,7 @@ class CompletionArgSuite extends BaseCompletionSuite {
|isResourceFile = isLargeBanana : Boolean
|""".stripMargin,
compat = Map(
"3.0" ->
"3" ->
"""|isResourceFile = : Boolean
|""".stripMargin
)
Expand All @@ -265,7 +265,7 @@ class CompletionArgSuite extends BaseCompletionSuite {
|""".stripMargin,
topLines = Some(3),
compat = Map(
"3.0" ->
"3" ->
"""|argument = : Int
|argument: Int
|""".stripMargin
Expand All @@ -291,7 +291,7 @@ class CompletionArgSuite extends BaseCompletionSuite {
|""".stripMargin,
topLines = Some(5),
compat = Map(
"3.0" ->
"3" ->
"""|argument = : Int
|Calendar - java.util
|""".stripMargin
Expand All @@ -313,7 +313,7 @@ class CompletionArgSuite extends BaseCompletionSuite {
|""".stripMargin,
topLines = Some(5),
compat = Map(
"3.0" ->
"3" ->
"""|`type` = : Int
|""".stripMargin
)
Expand Down
Loading

0 comments on commit 2e14a46

Please sign in to comment.