Skip to content

Commit

Permalink
Support Scala 3.3.4 (#1565)
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi authored Sep 28, 2024
1 parent 5519dcb commit 6342755
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 13 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ jobs:
command: 'terminal.__.test'

- java-version: 11
command: 'sshd[{2.12.20,2.13.15,3.4.3,3.5.1}].__.test'
command: 'sshd[{2.12.20,2.13.15,3.3.4,3.4.3,3.5.1}].__.test'

- java-version: 11
command: 'amm.repl[2.12.{9,14,20}].__.test'
- java-version: 17
command: 'amm.repl[2.13.{4,9,15}].__.test'
- java-version: 21
command: 'amm.repl[{3.4.3,3.5.1}].__.test'
command: 'amm.repl[{3.3.4,3.4.3,3.5.1}].__.test'

- java-version: 11
command: 'amm[2.12.{9,14,20}].__.test'
- java-version: 17
command: 'amm[2.13.{4,9,15}].__.test'
- java-version: 21
command: 'amm[{3.4.3,3.5.1}].__.test'
command: 'amm[{3.3.4,3.4.3,3.5.1}].__.test'

runs-on: ubuntu-latest
steps:
Expand All @@ -57,7 +57,7 @@ jobs:
- java-version: 17
scala-version: '2.13.{4,9,15}'
- java-version: 21
scala-version: '{3.4.3,3.5.1}'
scala-version: '{3.3.4,3.4.3,3.5.1}'

runs-on: ubuntu-latest
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class Compiler(
override protected def frontendPhases: List[List[Phase]] =
CompilerHelper.frontEndPhases ++
List(
List(new semanticdb.ExtractSemanticDB),
List(new semanticdb.ExtractSemanticDB.ExtractSemanticInfo),
List(new AmmonitePhase(userCodeNestingLevel, userCodeNestingLevel == 2)),
List(new PostTyper)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ object AmmCompletion extends AmmCompletionExtras {
mode: Completion.Mode,
prefix: String,
pos: SourcePosition
) extends Completion.Completer(mode, prefix, pos):
) extends Completion.Completer(mode, pos, Nil, n => n.startsWith(prefix)):
private def blacklisted(s: Symbol)(using Context) = {
val blacklist = Set(
"scala.Predef.any2stringadd.+",
Expand Down
6 changes: 3 additions & 3 deletions amm/src/test/scala/ammonite/main/LineNumberTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object LineNumberTests extends TestSuite {

val sv = ammonite.compiler.CompilerBuilder.scalaVersion
val isScala2 = sv.startsWith("2.")
val isPre3_4 = sv.take(4) <= "3.3."
val isPre3_3_4 = sv < "3.3.4"

test("sourcecode") {
if (isScala2) {
Expand Down Expand Up @@ -133,7 +133,7 @@ object LineNumberTests extends TestSuite {
s"""$path:14: not found: value printnl
|val res_0 = printnl("OK")
| ^""".stripMargin
else if (isPre3_4) {
else if (isPre3_3_4) {
val sp = " "
s"""-- [E006] Not Found Error: $path:1:12$sp
|1 |val res_0 = printnl("OK")
Expand Down Expand Up @@ -162,7 +162,7 @@ object LineNumberTests extends TestSuite {
s"""$path:30: not found: value prinntl
|val res = prinntl("Ammonite")
| ^""".stripMargin
else if (isPre3_4) {
else if (isPre3_3_4) {
val sp = " "
s"""-- [E006] Not Found Error: $path:3:10$sp
|3 |val res = prinntl("Ammonite")
Expand Down
8 changes: 5 additions & 3 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,19 @@ val scala2_13Versions = 2.to(15)
// .dropWhile(v => isJava21 && v < 11)
.map(v => s"2.13.${v}")
// TODO: We can't have 3.4.0 & 3.4.1 until we solve https://github.com/com-lihaoyi/Ammonite/issues/1395
val scala33Versions = Seq("3.3.4")
val scala34Versions = Seq("3.4.2", "3.4.3")
val scala35Versions = Seq("3.5.0", "3.5.1")

val scala2Versions = scala2_12Versions ++ scala2_13Versions
val scala3Versions = scala34Versions ++ scala35Versions
val scala3Versions = scala33Versions ++ scala34Versions ++ scala35Versions

val binCrossScalaVersions =
Seq(scala2_12Versions.last, scala2_13Versions.last, scala34Versions.last)
Seq(scala2_12Versions.last, scala2_13Versions.last, scala33Versions.last)
val assemblyCrossScalaVersions = Seq(
scala2_12Versions.last,
scala2_13Versions.last,
scala33Versions.last,
scala34Versions.last,
scala35Versions.last
)
Expand Down Expand Up @@ -144,7 +146,7 @@ object Deps {
val sshdCore = ivy"org.apache.sshd:sshd-core:1.2.0"
val scalametaCommon = ivy"org.scalameta::common:$scalametaVersion"
val typename = ivy"org.tpolecat::typename:1.1.0"
val upickle = ivy"com.lihaoyi::upickle:4.0.1"
val upickle = ivy"com.lihaoyi::upickle:4.0.2"

val utest = ivy"com.lihaoyi::utest:0.8.4"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object LineNumberTests extends TestSuite {
"""compilationErrorInSecondBlock.sc:14: not found: value printnl
|val res_0 = printnl("OK")
| ^""".stripMargin
else if (scalaVersion.dropWhile(_ != '.') < ".4")
else if (scalaVersion < "3.3.4")
s"""-- [E006] Not Found Error: ${replStandaloneResources / path}:1:12$sp
|1 |val res_0 = printnl("OK")
| | ^^^^^^^
Expand Down

0 comments on commit 6342755

Please sign in to comment.