Adjust to changes in develop branch

This commit is contained in:
Eugene Yokota 2023-01-16 00:23:05 -05:00
parent e8223cc8be
commit e5dd518deb
5 changed files with 22 additions and 7 deletions

View File

@ -91,7 +91,8 @@ object ConsoleOut {
override def toString: String = s"TerminalOut"
}
/** Same as terminalOut but it catches and ignores the ClosedChannelException
/**
* Same as terminalOut but it catches and ignores the ClosedChannelException
*/
def safeTerminalOut(terminal: Terminal): ConsoleOut = {
val out = terminalOut(terminal)
@ -100,7 +101,7 @@ object ConsoleOut {
override def print(s: String): Unit = catchException(out.print(s))
override def println(s: String): Unit = catchException(out.println(s))
override def println(): Unit = catchException(out.println())
override def flush(): Unit = catchException(out.flush)
override def flush(): Unit = catchException(out.flush())
override def toString: String = s"SafeTerminalOut($terminal)"
private def catchException(f: => Unit): Unit = {
try f

View File

@ -669,7 +669,12 @@ object BuildServerProtocol {
if dep != thisProjectRef || config.name != thisConfig.name
} yield (dep / config / Keys.bspTargetIdentifier)
val capabilities =
BuildTargetCapabilities(canCompile = true, canTest = true, canRun = true, canDebug = false)
BuildTargetCapabilities(
canCompile = true,
canTest = true,
canRun = true,
canDebug = false
)
val tags = BuildTargetTag.fromConfig(configuration.name)
(
buildTargetIdentifier,

View File

@ -5,8 +5,14 @@
// DO NOT EDIT MANUALLY
package sbt.internal.bsp.codec
import _root_.sjsonnew.{ Unbuilder, Builder, JsonFormat, deserializationError }
trait InitializeBuildResultFormats { self: sbt.internal.bsp.codec.BuildServerCapabilitiesFormats with sbt.internal.bsp.codec.CompileProviderFormats with sjsonnew.BasicJsonProtocol with sbt.internal.bsp.codec.TestProviderFormats with sbt.internal.bsp.codec.RunProviderFormats with sbt.internal.util.codec.JValueFormats =>
implicit lazy val InitializeBuildResultFormat: JsonFormat[sbt.internal.bsp.InitializeBuildResult] = new JsonFormat[sbt.internal.bsp.InitializeBuildResult] {
trait InitializeBuildResultFormats { self: sbt.internal.bsp.codec.BuildServerCapabilitiesFormats
with sbt.internal.bsp.codec.CompileProviderFormats
with sjsonnew.BasicJsonProtocol
with sbt.internal.bsp.codec.TestProviderFormats
with sbt.internal.bsp.codec.RunProviderFormats
with sbt.internal.util.codec.JValueFormats
with sbt.internal.bsp.codec.DebugProviderFormats =>
implicit lazy val InitializeBuildResultFormat: JsonFormat[sbt.internal.bsp.InitializeBuildResult] = new JsonFormat[sbt.internal.bsp.InitializeBuildResult] {
override def read[J](__jsOpt: Option[J], unbuilder: Unbuilder[J]): sbt.internal.bsp.InitializeBuildResult = {
__jsOpt match {
case Some(__js) =>

View File

@ -66,7 +66,9 @@ object BuildServerConnection {
val envPath = sys.env.collectFirst {
case (k, v) if k.toUpperCase() == "PATH" => v
}
val allPaths = envPath.map(_.split(File.pathSeparator).map(Paths.get(_))).getOrElse(Array.empty)
val allPaths = envPath match
case Some(path) => path.split(File.pathSeparator).toList.map(Paths.get(_))
case _ => Nil
allPaths
.map(_.resolve(fileName))
.find(file => Files.exists(file) && Files.isExecutable(file))

View File

@ -158,7 +158,8 @@ object Fork {
}
}
/** Use an arguments file if:
/**
* Use an arguments file if:
* - we are on jdk >= 9
* - sbt.argfile is unset or not falsy
* - the command line length would exceed MaxConcatenatedOptionLength