Skip to content

Commit

Permalink
chore: Add support for Scala 2.13.12
Browse files Browse the repository at this point in the history
  • Loading branch information
tgodzik committed Sep 6, 2023
1 parent af6f11e commit e94ef38
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
METALS_VERSION=$(echo $GITHUB_REF_NAME | cut -d "_" -f2 | cut -c2-)
SCALA_VERSION=$(echo $GITHUB_REF_NAME | cut -d "_" -f3)
if [ ! -z $METALS_VERSION ] && [ ! -z $SCALA_VERSION ]; then
export CI_RELEASE="++$SCALA_VERSION! mtags/publishSigned"
export CI_RELEASE="++$SCALA_VERSION! mtags/publishSigned; mtagsShared/publishSigned"
UPDATE_DOCS=false
COMMAND="; set ThisBuild/version :=\"$METALS_VERSION\"; $COMMAND"
else
Expand Down
2 changes: 2 additions & 0 deletions bin/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ coursier fetch \
org.scalameta:mtags_3.2.1:$version \
org.scalameta:mtags_3.2.2:$version \
org.scalameta:mtags_3.3.0:$version \
org.scalameta:mtags_3.3.1:$version \
org.scalameta:mtags_2.13.1:$version \
org.scalameta:mtags_2.13.2:$version \
org.scalameta:mtags_2.13.3:$version \
Expand All @@ -26,6 +27,7 @@ coursier fetch \
org.scalameta:mtags_2.13.9:$version \
org.scalameta:mtags_2.13.10:$version \
org.scalameta:mtags_2.13.11:$version \
org.scalameta:mtags_2.13.12:$version \
org.scalameta:mtags_2.12.9:$version \
org.scalameta:mtags_2.12.10:$version \
org.scalameta:mtags_2.12.11:$version \
Expand Down
3 changes: 2 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ val mtagsSettings = List(
val regex = "(\\d+)\\.(\\d+)\\.(\\d+).*".r
// For scala +2.13.9 we need to have a special Compat.scala
// For this case filter out `scala-2.13` directory that comes by default
val scalaVersionsWithSpecialCompat = Set("2.13.9", "2.13.10", "2.13.11")
val scalaVersionsWithSpecialCompat =
Set("2.13.9", "2.13.10", "2.13.11", "2.13.12")
if (scalaVersionsWithSpecialCompat(scalaVersion.value))
current.filter(f => f.getName() != "scala-2.13")
else if (isScala3WithPresentationCompiler(scalaVersion.value))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ object MtagsResolver {
"2.13.1" -> "0.11.10",
"2.13.2" -> "0.11.10",
"2.13.3" -> "0.11.12",
"2.13.4" -> "1.0.1",
"2.12.9" -> "0.11.10",
"2.12.10" -> "0.11.12",
"3.0.0" -> "0.11.10",
Expand Down
26 changes: 26 additions & 0 deletions mtags/src/main/scala-2.13.12/meta/internal/pc/Compat.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package scala.meta.internal.pc

import scala.reflect.internal.Reporter
import scala.tools.nsc.reporters.StoreReporter

trait Compat { this: MetalsGlobal =>
def metalsFunctionArgTypes(tpe: Type): List[Type] =
definitions.functionOrPfOrSamArgTypes(tpe)

val AssignOrNamedArg: NamedArgExtractor = NamedArg

def storeReporter(r: Reporter): Option[StoreReporter] =
r match {
case s: StoreReporter => Some(s)
case _ => None
}

def isAliasCompletion(m: Member): Boolean = m match {
case tm: TypeMember => tm.aliasInfo.nonEmpty
case sm: ScopeMember => sm.aliasInfo.nonEmpty
case _ => false
}

def constantType(c: ConstantType): ConstantType =
if (c.value.isSuitableLiteralType) LiteralType(c.value) else c
}
6 changes: 3 additions & 3 deletions project/V.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ object V {
val scala210 = "2.10.7"
val scala211 = "2.11.12"
val scala212 = "2.12.18"
val scala213 = "2.13.11"
val scala213 = "2.13.12"
val scala3 = "3.3.0"
val firstScala3PCVersion = "3.3.2-RC1-bin-20230721-492f777-NIGHTLY"
// When you can add to removedScalaVersions in MtagsResolver.scala with the last released version
Expand Down Expand Up @@ -73,10 +73,10 @@ object V {
"2.12.12",
"2.12.13",
"2.12.14",
"2.13.4",
"2.13.5",
"2.13.6",
"2.13.7",
"2.13.8",
)

def nonDeprecatedScala2Versions = Seq(
Expand All @@ -85,9 +85,9 @@ object V {
"2.12.17",
"2.12.16",
"2.12.15",
"2.13.8",
"2.13.9",
"2.13.10",
"2.13.11",
)

def minimumSupportedSbtVersion = {
Expand Down
4 changes: 4 additions & 0 deletions tests/cross/src/test/scala/tests/pc/CompletionDocSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,10 @@ class CompletionDocSuite extends BaseCompletionSuite {
s"""|$scala213Docs
|StringBuilder scala.collection.mutable
|""".stripMargin,
"2.13.12" ->
s"""|$scala213Docs
|StringBuilder scala.collection.mutable
|""".stripMargin,
),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class CompletionScalaCliSuite extends BaseCompletionSuite {
check(
"plugin".tag(
IgnoreScalaVersion(version =>
Set("2.12.16", "2.12.18", "2.13.11")(version) ||
Set("2.12.16", "2.13.12", "3.3.1")(version) ||
version.contains(
"NIGHTLY"
) || version.contains(
Expand Down
7 changes: 7 additions & 0 deletions tests/cross/src/test/scala/tests/pc/CompletionSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,13 @@ class CompletionSuite extends BaseCompletionSuite {
|implicitConversions scala.languageFeature
|postfixOps scala.languageFeature
|""".stripMargin,
"2.13.12" ->
"""|dynamics scala.languageFeature
|existentials scala.languageFeature
|experimental scala.languageFeature
|implicitConversions scala.languageFeature
|postfixOps scala.languageFeature
|""".stripMargin,
scala3PresentationCompilerVersion ->
"""|dynamics scala.languageFeature
|existentials scala.languageFeature
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class SignatureHelpDocSuite extends BaseSignatureHelpSuite {
)

val addedSpace: String =
if (BuildInfo.scalaCompilerVersion == "2.13.11") "" else " "
if (Set("2.13.11", "2.13.12")(BuildInfo.scalaCompilerVersion)) "" else " "
checkDoc(
"curry3",
"""
Expand Down

0 comments on commit e94ef38

Please sign in to comment.