Skip to content

Commit

Permalink
Merge pull request #35 from scala-cli/warn-on-bsp-socket-closed
Browse files Browse the repository at this point in the history
Only warn when the BSP socket gets closed
  • Loading branch information
alexarchambault authored Jan 20, 2022
2 parents 2249791 + 279dcda commit a4ddcf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/main/scala/bloop/bsp/BspServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ object BspServer {
val server = new BloopLanguageServer(messages, client, provider.services, ioScheduler, bspLogger)
// FORMAT: ON

def warn(msg: String): Unit = provider.stateAfterExecution.logger.warn(msg)
def error(msg: String): Unit = provider.stateAfterExecution.logger.error(msg)

/* This implementation of starting a server relies on two observables:
Expand Down Expand Up @@ -129,7 +130,7 @@ object BspServer {
}

try {
if (cancelled) error(s"BSP server cancelled, closing socket...")
if (cancelled) warn(s"BSP server cancelled, closing socket...")
else result.foreach(t => error(s"BSP server stopped by ${t.getMessage}"))
cancelable.cancel()
server.cancelAllRequests()
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/test/scala/bloop/DeduplicationSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,11 @@ object DeduplicationSpec extends bloop.bsp.BspBaseSuite {
}

test("deduplication doesn't work if project definition changes") {
TestUtil.retry() {
deduplicationIfProjectDefinitionChangesTest()
}
}
def deduplicationIfProjectDefinitionChangesTest(): Unit = {
val logger = new RecordingLogger(ansiCodesSupported = false)
BuildUtil.testSlowBuild(logger) { build =>
val state = new TestState(build.state)
Expand Down

0 comments on commit a4ddcf9

Please sign in to comment.