Skip to content
Open
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
6 changes: 0 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ lazy val V =
val moped = "0.2.0"
val gradle = "7.0"
val scala213 = "2.13.13"
val scala212 = "2.12.19"
val scala211 = "2.11.12"
val scala3 = "3.3.3"
val metals = "1.2.2"
val scalameta = "4.9.3"
Expand Down Expand Up @@ -140,8 +138,6 @@ lazy val gradlePlugin = project
"semanticdbVersion" -> V.scalameta,
"semanticdbKotlincVersion" -> V.semanticdbKotlin,
"mtagsVersion" -> V.metals,
"scala211" -> V.scala211,
"scala212" -> V.scala212,
"scala213" -> V.scala213,
"scala3" -> V.scala3,
"bspVersion" -> V.bsp,
Expand Down Expand Up @@ -268,8 +264,6 @@ lazy val cli = project
"semanticdbVersion" -> V.scalameta,
"semanticdbKotlincVersion" -> V.semanticdbKotlin,
"mtagsVersion" -> V.metals,
"scala211" -> V.scala211,
"scala212" -> V.scala212,
"scala213" -> V.scala213,
"scala3" -> V.scala3,
"bspVersion" -> V.bsp,
Expand Down
5 changes: 2 additions & 3 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,8 @@ by [Metals](https://scalameta.org/metals), the Scala language server.

| Scala version | Goto definition | Find references | Hover |
| ------------- | --------------- | --------------- | ----- |
| Scala 2.10.x | ❌ | ❌ | ❌ |
| Scala 2.11.x | ✅ | ✅ | ✅ |
| Scala 2.12.x | ✅ | ✅ | ✅ |
| Scala 2.11.x | ❌ | ❌ | ❌ |
| Scala 2.12.x | ❌ | ❌ | ❌ |
| Scala 2.13.x | ✅ | ✅ | ✅ |
| Scala 3.x | ✅ | ✅ | ❌ |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,19 @@ object ScalaVersion {
* 2.13.
* - We should only infer Scala versions that are supported by the
* `org.scalameta:mtags` module, which we use to compile SemanticDB files.
* Currently, mtags supports the latest patch releases of Scala 2.11,
* 2.12, 2.13 and Scala 3.
* Currently, mtags supports the latest patch releases of Scala 2.13 and
* Scala 3.
*/
def inferFromJar(jar: Path): Option[String] = {
val Scala3 = ".*_3\\b.*".r
val Scala211 = ".*_2.11\\b.*".r
val Scala212 = ".*_2.12\\b.*".r
val Scala213 = ".*_2.13\\b.*".r
// The official Scala 2 distribution doesn't use the standard _2.N suffix
// So we add a special case for scala-{compiler,reflect,library} and scalap.
val ScalaOfficial =
".*scala(p|-compiler|-reflect|-library)?-2.([^\\.]+).*.jar".r
Option(jar.getFileName.toString).collect {
case Scala3() =>
BuildInfo.scala3
case Scala211() =>
BuildInfo.scala211
case Scala212() =>
BuildInfo.scala212
case Scala213() =>
BuildInfo.scala213
case ScalaOfficial(_, "11") =>
BuildInfo.scala211
case ScalaOfficial(_, "12") =>
BuildInfo.scala212
case ScalaOfficial(_, "13") =>
BuildInfo.scala213
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ abstract class GradleBuildToolSuite(gradle: Tool.Gradle)
| mavenCentral()
|}
|dependencies {
| implementation 'org.scala-lang:scala-library:2.12.12'
| implementation 'org.scala-lang:scala-library:2.13.13'
|}
|/src/main/java/foo/JExample.java
|package foo;
Expand All @@ -358,7 +358,7 @@ abstract class GradleBuildToolSuite(gradle: Tool.Gradle)
|""".stripMargin,
expectedSemanticdbFiles = 4,
gradleVersions = List(Gradle8, Gradle7, Gradle6),
tools = List(Scala2_12_12)
tools = List(Scala213)
)
checkGradleBuild(
"kotlin2",
Expand Down
10 changes: 3 additions & 7 deletions tests/buildTools/src/test/scala/tests/MillBuildToolSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,20 @@ class MillBuildToolSuite extends BaseBuildToolSuite {
).mkString("\n")
else if (scalaVersion.startsWith("2.13"))
"maven:org.scala-lang:scala-library:2.13.8"
else if (scalaVersion.startsWith("2.12"))
"maven:org.scala-lang:scala-library:2.12.19"
else
"idn fail, we don't cover this scala version"
throw new IllegalArgumentException(s"Unsupported Scala version: $scalaVersion")

def scalaBinaryVersion(scalaVersion: String) =
if (scalaVersion.startsWith("3"))
"3"
else if (scalaVersion.startsWith("2.13"))
"2.13"
else if (scalaVersion.startsWith("2.12"))
"2.12"
else
"idn fail, we don't cover this scala version"
throw new IllegalArgumentException(s"Unsupported Scala version: $scalaVersion")

for {
mill <- List(Mill0_10, Mill0_11)
scala <- List(Scala212, Scala2_13_8, Scala3)
scala <- List(Scala2_13_8, Scala3)
} yield {

checkBuild(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,6 @@ class ScipBuildToolSuite extends BaseBuildToolSuite {
)

List(
ScalaCombination("2.11", V.scala211, V.scala211),
ScalaCombination("2.12", V.scala212, V.scala212),
ScalaCombination("2.13", V.scala213, V.scala213),
// The Scala 2.13 version of the build and the Scala 2.13 version of
// Scala 3's standard library are not necessarily aligned
Expand Down
3 changes: 0 additions & 3 deletions tests/buildTools/src/test/scala/tests/Tool.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ object Tool {
extends Tool("scala", version, support)
// See https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html
case object Scala213 extends Scala("2.13.13", noRestrictions)
case object Scala212 extends Scala("2.12.19", noRestrictions)
case object Scala2_12_12 extends Scala("2.12.12", atMostJava(11))
case object Scala2_13_8 extends Scala("2.13.8", atMostJava(17))
case object Scala211 extends Scala("2.11.9", atMostJava(11))
case object Scala3 extends Scala("3.3.3", noRestrictions)

sealed abstract class Mill(version: String, support: JVMSupport)
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/src/test/scala/tests/ScalaVersionSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ class ScalaVersionSuite extends FunSuite {

checkNone("junit-4.13.2")
checkNone("scala-library-2.10.1.jar")
check("scala-library-2.11.1.jar", V.scala211)
check("scala-library-2.12.1.jar", V.scala212)
checkNone("scala-library-2.11.1.jar")
checkNone("scala-library-2.12.1.jar")
check("scala-compiler-2.13.1.jar", V.scala213)
check("scala-reflect-2.13.1.jar", V.scala213)
check("scala-library-2.13.1.jar", V.scala213)
check("scalap-2.13.1.jar", V.scala213)
checkNone("scala-library-2.14.1.jar")

check("geny_2.11-0.10.5.jar", V.scala211)
check("geny_2.12-0.10.5.jar", V.scala212)
checkNone("geny_2.11-0.10.5.jar")
checkNone("geny_2.12-0.10.5.jar")
check("geny_2.13-0.10.5.jar", V.scala213)
check("geny_3-0.10.5.jar", V.scala3)

Expand Down
Loading