Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: fix worksheets with 3.4.0 #6212

Merged
merged 3 commits into from Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
@@ -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)
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