Merge pull request #8051 from eed3si9n/wip/revert-run-switching

[1.x] Revert run switching on 1.x
This commit is contained in:
eugene yokota 2025-03-03 11:23:33 -05:00 committed by GitHub
commit 0c1fd9aff7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 21 deletions

View File

@ -148,21 +148,6 @@ final class NetworkChannel(
self.onCancellationRequest(execId, crp)
}
// Take over commandline for network channel
private val networkCommand: PartialFunction[String, String] = {
case cmd if cmd.split(" ").head.split("/").last == "run" =>
s"clientJob $cmd"
}
override protected def appendExec(commandLine: String, execId: Option[String]): Boolean =
if (clientCanWork && networkCommand.isDefinedAt(commandLine))
super.appendExec(networkCommand(commandLine), execId)
else super.appendExec(commandLine, execId)
override private[sbt] def onCommandLine(cmd: String): Boolean =
if (clientCanWork && networkCommand.isDefinedAt(cmd))
appendExec(networkCommand(cmd), None)
else super.onCommandLine(cmd)
protected def setInitializeOption(opts: InitializeOption): Unit = initializeOption.set(opts)
// Returns true if sbtn has declared with canWork: true

View File

@ -68,7 +68,7 @@ object ClientTest extends AbstractServerTest {
false
)
)
private def clientWithStdoutLines(args: String*): (Int, Seq[String]) = {
def clientWithStdoutLines(args: String*): (Int, Seq[String]) = {
val out = new CachingPrintStream
val exitCode = background(
NetworkClient.client(
@ -120,11 +120,6 @@ object ClientTest extends AbstractServerTest {
test("three commands with middle failure") { _ =>
assert(client("compile;willFail;willSucceed") == 1)
}
test("run") { _ =>
val (exitCode, lines) = clientWithStdoutLines("run")
assert(exitCode == 0)
assert(lines.toList.exists(_.endsWith("Hello, World!")))
}
test("compi completions") { _ =>
val expected = Vector(
"compile",