Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Scala 3 3.0.0-M2 #2260

Merged
merged 1 commit into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ lazy val V = new {
val semanticdb = scalameta
val bsp = "2.0.0-M13"
val bloop = "1.4.5-6-4768184c"
val scala3 = "3.0.0-M1"
val scala3 = "3.0.0-M2"
val bloopNightly = bloop
val sbtBloop = bloop
val gradleBloop = bloop
val mavenBloop = bloop
val mdoc = "2.2.12"
val mdoc = "2.2.13"
val scalafmt = "2.7.4"
val munit = "0.7.17"
val munit = "0.7.19"
val scalafix = "0.9.23"
val lsp4jV = "0.10.0"
// List of supported Scala versions in SemanticDB. Needs to be manually updated
Expand All @@ -214,7 +214,7 @@ lazy val V = new {
def scala2Versions = nonDeprecatedScala2Versions ++ deprecatedScala2Versions

// Scala 3
def nonDeprecatedScala3Versions = Seq(scala3, "0.27.0-RC1")
def nonDeprecatedScala3Versions = Seq(scala3, "3.0.0-M1", "0.27.0-RC1")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because I don't fully remember where we ended up on this. How long will we keep 0.27.0-RC1 around as non-deprecated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably under the end of the course at EPFL.

def deprecatedScala3Versions = Seq("0.26.0")
def scala3Versions = nonDeprecatedScala3Versions ++ deprecatedScala3Versions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ object Embedded {
scalaVersion: String,
scalaBinaryVersion: String
): Dependency = {
// Mdoc support for 0.27.0-RC1 was dropped with "2.2.11"
// Mdoc support for 0.27.0-RC1 was dropped with "2.2.11" and for 3.0.0-M1 with "2.12.13"
val mdocVersion =
if (scalaVersion == "0.27.0-RC1") "2.2.10" else BuildInfo.mdocVersion
if (scalaVersion == "0.27.0-RC1") "2.2.10"
else if (scalaVersion == "3.0.0-M1") "2.2.12"
else BuildInfo.mdocVersion
Comment on lines +187 to +189
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly don't love that we are doing this. Was it just not possible to publish mdoc for both M1 and M2? It seems a bit extreme that have to have logic to include 1 of 3 different versions of a single dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed simpler to just put in the logic here. We need to double the code for each Scala 3 version currently and it's really only Metals doing it. I might have been too quick, but there was no real changes between all those changes that would impact worksheets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After the changes in scala/scala3#10172 we should be able to just do scalameta/mdoc@81e43c1

Dependency.of(
"org.scalameta",
s"mdoc_${scalaBinaryVersion}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import scala.meta.internal.semver.SemVer

object ScalaVersions {

val scala3Milestones: Set[String] = Set("3.0.0-M1", "3.0.0-M2")

/**
* Non-Lightbend compilers often use a suffix, such as `-bin-typelevel-4`
*/
Expand Down Expand Up @@ -76,7 +78,7 @@ object ScalaVersions {
) == mtags.BuildInfo.scalaCompilerVersion

def scalaBinaryVersionFromFullVersion(scalaVersion: String): String = {
if (scalaVersion == "3.0.0-M1")
if (scala3Milestones(scalaVersion))
scalaVersion
else
scalaVersion.split('.').take(2).mkString(".")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ class CancelCompletionSuite extends BaseCompletionSuite {
|assert(assertion: Boolean, message: => Any): Unit
|""".stripMargin,
compat = Map(
"3.0.0-M2" ->
"""|assert(assertion: Boolean @InlineParam): Unit
|""".stripMargin,
"3.0" ->
"""|assert(assertion: Boolean @InlineParam): Unit
|assertFail(message: => Any): Nothing
Expand Down