Skip to content

Commit

Permalink
improvement: by default support scala-cli power options
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek authored and tgodzik committed Dec 12, 2024
1 parent ac01eef commit 83fc6d2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ final class BspServers(
args,
projectDirectory,
redirectErrorOutput = false,
variables,
variables + ("SCALA_CLI_POWER" -> "true"),
processOut = None,
processErr = Some(l => scribe.info("BSP server: " + l)),
discardInput = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ object ScalaCli {
command.toList,
workspace,
redirectErrorOutput = false,
env = Map(),
env = Map("SCALA_CLI_POWER" -> "true"),
processOut = None,
processErr = Some(line => scribe.info("Scala CLI: " + line)),
discardInput = false,
Expand Down
15 changes: 15 additions & 0 deletions tests/slow/src/test/scala/tests/scalacli/ScalaCliSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -782,4 +782,19 @@ class ScalaCliSuite extends BaseScalaCliSuite("3.3.3") {
_ = assertNoDiff(completion, "com.lihaoyi")
} yield ()
}

test("power-option") {
cleanWorkspace()
for {
_ <- scalaCliInitialize(useBsp = true)(
s"""|/MyTests.scala
|//> using scala ${scalaVersion}
|//> using packaging.dockerFrom openjdk:17
|
|def main() = println("Hello world!")
|""".stripMargin
)
_ <- server.didOpen("MyTests.scala")
} yield assertNoDiagnostics()
}
}

0 comments on commit 83fc6d2

Please sign in to comment.