Skip to content

Commit

Permalink
Use parallel-collections in 2.13 scala native
Browse files Browse the repository at this point in the history
Was previously impossible, as parallel-collections
library was not yet released for scala native as of making
the scala native PR.
  • Loading branch information
jchyb committed Feb 3, 2025
1 parent fe4f758 commit ecb7425
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 49 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ lazy val sysops = crossProject(JVMPlatform, NativePlatform)
case Some((2, 12)) =>
Seq("com.github.bigwheel" %% "util-backports" % "2.1")
case Some((2, 13)) =>
Seq("org.scala-lang.modules" %% "scala-parallel-collections" % "1.2.0")
Seq("org.scala-lang.modules" %%% "scala-parallel-collections" % "1.2.0")
case _ => Seq()
}
},
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.scalafmt

private[scalafmt] object CompatCollections {
val JavaConverters = scala.collection.JavaConverters
object ParConverters
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.scalafmt

private[scalafmt] object CompatCollections {
val JavaConverters = scala.jdk.CollectionConverters
val ParConverters = scala.collection.parallel.CollectionConverters
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ScalafmtProps extends FunSuite with FormatAssertions {
val corpus = Corpus.files(
// TODO(olafur) remove once testkit 1.7 is out
Corpus.fastparse.copy(Corpus.fastparse.url.replace("olafurpg", "scalameta")),
).take(count).toBuffer.compatPar
).take(count).toBuffer.par
SyntaxAnalysis.run[Observation[Bug]](corpus) { file =>
val code = file.read
try Scalafmt.format(code, config) match {
Expand Down

0 comments on commit ecb7425

Please sign in to comment.