Skip to content

Commit

Permalink
Merge pull request #688 from scalacenter/topic/upgrade-bsp-1.0.1-M2
Browse files Browse the repository at this point in the history
Upgrade to bsp 1.0.1-M3 to use status code
  • Loading branch information
jvican authored Oct 22, 2018
2 parents ccbc95e + 045355b commit 573affb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
6 changes: 3 additions & 3 deletions frontend/src/main/scala/bloop/bsp/BloopBspServices.scala
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,9 @@ final class BloopBspServices(
currentState = state
val status = {
val exitStatus = state.status
if (isCancelled) bsp.ExitStatus.Cancelled
else if (exitStatus.isOk) bsp.ExitStatus.Ok
else bsp.ExitStatus.Error
if (isCancelled) bsp.StatusCode.Cancelled
else if (exitStatus.isOk) bsp.StatusCode.Ok
else bsp.StatusCode.Error
}
Right(bsp.RunResult(None, status))
}
Expand Down
6 changes: 6 additions & 0 deletions frontend/src/main/scala/bloop/logging/BspServerLogger.scala
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ final class BspServerLogger private (

override def error(msg: String): Unit = {
Build.logMessage.notify(bsp.LogMessageParams(bsp.MessageType.Error, None, None, msg))
()
}

override def warn(msg: String): Unit = {
Build.logMessage.notify(bsp.LogMessageParams(bsp.MessageType.Warning, None, None, msg))
()
}

override def info(msg: String): Unit = {
Build.logMessage.notify(bsp.LogMessageParams(bsp.MessageType.Info, None, None, msg))
()
}

def diagnostic(problem: Problem): Unit = {
Expand Down Expand Up @@ -81,6 +84,7 @@ final class BspServerLogger private (
case Severity.Info => info(message)
}
}
()
}

def publishBspReport(uri: bsp.Uri, problems: Seq[Problem]): Unit = {
Expand All @@ -89,6 +93,7 @@ final class BspServerLogger private (
BuildTarget.compileReport.notify(
bsp.CompileReport(bsp.BuildTargetIdentifier(uri), None, errors, warnings, None)
)
()
}

override def log[M](record: LogRecord[M]): Unit = {
Expand All @@ -105,6 +110,7 @@ final class BspServerLogger private (
case None => error(record.message)
}
}
()
}
}

Expand Down
1 change: 1 addition & 0 deletions frontend/src/main/scala/bloop/testing/TestSuiteEvent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ final class BspLoggingEventHandler(id: BuildTargetIdentifier, logger: Logger, cl
val failed = suitesFailed.length
val r = bsp.TestReport(id, None, suitesPassed, failed, 0, 0, 0, 0, Some(suitesDuration))
BuildTarget.testReport.notify(r)
()
}
}

Expand Down
8 changes: 4 additions & 4 deletions frontend/src/test/scala/bloop/bsp/BspProtocolSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,11 @@ class BspProtocolSpec {
case Left(e) => Left(e)
case Right(result) =>
if (checkCompiledUtest && checkCompiledUtestTest) {
result.exitStatus match {
case bsp.ExitStatus.Ok => Right(result)
case bsp.ExitStatus.Error =>
result.statusCode match {
case bsp.StatusCode.Ok => Right(result)
case bsp.StatusCode.Error =>
Left(Response.internalError("Status code of run is an error!"))
case bsp.ExitStatus.Cancelled =>
case bsp.StatusCode.Cancelled =>
Left(Response.internalError("Status code of cancelled is an error!"))
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ object Dependencies {

val nailgunVersion = "0c8b937b"
val zincVersion = "1.2.1+104-55d3c3d5"
val bspVersion = "1.0.1-M1"
val bspVersion = "1.1.0"
val scalazVersion = "7.2.20"
val coursierVersion = "1.1.0-M3"
val lmVersion = "1.0.0"
Expand Down

0 comments on commit 573affb

Please sign in to comment.