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 committed Dec 11, 2024
1 parent ac01eef commit 5575a36
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 5575a36

Please sign in to comment.