Skip to content

Commit

Permalink
bugfix: fix worksheets with 3.4.0 (#6212)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek authored Mar 13, 2024
1 parent ee66d2a commit 6c1f106
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ final class Embedded(
pathString.contains("mdoc") ||
pathString.contains("scalameta") ||
pathString.contains("metaconfig") ||
pathString.contains("diffutils")
pathString.contains("diffutils") ||
pathString.contains("scala-sbt")
}
val urls = runtimeClasspath.iterator.map(_.toUri().toURL()).toArray
new URLClassLoader(urls, parent)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package tests.feature

import scala.meta.internal.metals.MetalsEnrichments._
import scala.meta.internal.metals.{BuildInfo => V}
import scala.meta.internal.semver.SemVer

import coursierapi.Complete

class Worksheet211LspSuite extends tests.BaseWorksheetLspSuite(V.scala211)

class Worksheet3LspSuite extends tests.BaseWorksheetLspSuite(V.scala3) {
Expand All @@ -25,4 +28,28 @@ class LatestWorksheet3LspSuite
"""given str: String = """""
}

class Worksheet3NextSuite
extends tests.BaseWorksheetLspSuite(Worksheet3NextSuite.scala3Next) {
override def versionSpecificCodeToValidate: String =
"""given str: String = """""
}

object Worksheet3NextSuite {
def scala3Next: String =
Complete
.create()
.withInput("org.scala-lang:scala3-compiler_3:")
.complete()
.getCompletions()
.asScala
.toList
.reverse
.collectFirst { version =>
SemVer.Version.fromString(version) match {
case SemVer.Version(_, _, _, None, None, None) => version
}
}
.get
}

class Worksheet212LspSuite extends tests.BaseWorksheetLspSuite(V.scala212)
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ abstract class BaseWorksheetLspSuite(
_ = assertNoDiff(noCompletions, "")
} yield ()
}
if (ScalaVersions.isScala3Version(scalaVersion))
if (ScalaVersions.isScala3Version(scalaVersion) && scalaVersion != "3.4.0")
test("import-missing-symbol") {
cleanWorkspace()
val path = "a/src/main/scala/foo/Main.worksheet.sc"
Expand Down

0 comments on commit 6c1f106

Please sign in to comment.