Skip to content

Commit b9ee36c

Browse files
Merge pull request #131 from alexarchambault/merge-upstream
Merge upstream changes
2 parents b650220 + ad6a65a commit b9ee36c

File tree

27 files changed

+224
-158
lines changed

27 files changed

+224
-158
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@
33

44
# Scala Steward: Reformat with scalafmt 3.6.1
55
77bc6a5845189a9659476d29fd7c02be5327ab8a
6+
7+
# Scala Steward: Reformat with scalafmt 3.7.0
8+
938cf56606b4900cbd7679725441fbbbe979bcaf

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.6.1"
1+
version = "3.7.2"
22
runner.dialect = scala213
33
maxColumn = 100
44
docstrings.style = Asterisk

backend/src/main/scala/bloop/task/Task.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ sealed trait Task[+A] { self =>
132132

133133
final def transform[R](fa: A => R, fe: Throwable => R): Task[R] =
134134
Task.Transform(
135-
(t: MonixTask[A]) => t.transform(fa, fe),
135+
(t: MonixTask[A]) => t.redeem(fe, fa),
136136
self,
137137
List.empty
138138
)
@@ -639,7 +639,7 @@ object Task {
639639

640640
def liftMonixTask[A](t: MonixTask[A], cancel: () => Unit): Task[A] =
641641
Task.create { (sh, cb) =>
642-
t.runAsync(sh)
642+
t.runToFuture(sh)
643643
.onComplete {
644644
case Success(v) => cb.onSuccess(v)
645645
case Failure(e) => cb.onError(e)

backend/src/main/scala/bloop/util/Java8Compat.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import scala.util.control.NonFatal
1515

1616
import monix.execution.Cancelable
1717
import monix.execution.CancelableFuture
18-
import monix.execution.cancelables.SingleAssignmentCancelable
18+
import monix.execution.cancelables.SingleAssignCancelable
1919
import monix.execution.schedulers.TrampolinedRunnable
2020

2121
/**
@@ -58,7 +58,7 @@ object Java8Compat {
5858
)(implicit ec: ExecutionContext): CancelableFuture[A] = {
5959

6060
val p = Promise[A]()
61-
val cRef = SingleAssignmentCancelable()
61+
val cRef = SingleAssignCancelable()
6262

6363
// Light async boundary to guard against stack overflows
6464
ec.execute(new TrampolinedRunnable {

backend/src/main/scala/sbt/internal/inc/bloop/internal/BloopAnalysisCallback.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ final class BloopAnalysisCallback(
129129
val map = if (reported) reportedProblems else unreportedProblems
130130
map
131131
.getOrElseUpdate(source.toPath(), new mutable.ListBuffer())
132-
.+=(InterfaceUtil.problem(category, pos, msg, severity, None))
132+
.+=(InterfaceUtil.problem(category, pos, msg, severity, None, None, Nil))
133133
}
134134
}
135135

backend/src/main/scala/sbt/internal/inc/bloop/internal/BloopHighLevelCompiler.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ final class BloopHighLevelCompiler(
133133
logger
134134
)
135135
} catch {
136+
case t: StackOverflowError =>
137+
val msg = "Encountered a StackOverflowError coming from the compiler. You might need to restart your Bloop build server"
138+
logger.error(s"${msg}:\n${t.getStackTrace().mkString("\n")}")
139+
throw new CompileFailed(new Array(0), msg, new Array(0), t)
136140
case NonFatal(t) =>
137141
// If scala compilation happens, complete the java promise so that it doesn't block
138142
JavaCompleted.tryFailure(t)

backend/src/main/scala/sbt/internal/inc/bloop/internal/ConcurrentAnalysisCallback.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ final class ConcurrentAnalysisCallback(
134134
val map = if (reported) reportedProblems else unreportedProblems
135135
map
136136
.getOrElseUpdate(source.toPath(), new ConcurrentLinkedQueue)
137-
.add(InterfaceUtil.problem(category, pos, msg, severity, None))
137+
.add(InterfaceUtil.problem(category, pos, msg, severity, None, None, Nil))
138138
}
139139
}
140140

backend/src/test/scala/bloop/task/TaskSpec.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class TaskSpec {
128128
Cancelable.empty
129129
}
130130
.runAsync
131-
val out = Await.result(future, 1.second)
131+
val out = Await.result(future, 1.second).toLong
132132
assertEquals(out, 42)
133133
}
134134

@@ -141,14 +141,14 @@ class TaskSpec {
141141
)(_ + _)
142142
.runAsync
143143

144-
val out = Await.result(future, 1.second)
144+
val out = Await.result(future, 1.second).toLong
145145
assertEquals(out, 3)
146146
}
147147

148148
@Test
149149
def memoize1: Unit = {
150150
val memoizedTime = Task
151-
.create[Long] { (sh, cb) =>
151+
.create[Long] { (_, cb) =>
152152
cb.onSuccess(System.currentTimeMillis())
153153
Cancelable.empty
154154
}
@@ -166,7 +166,7 @@ class TaskSpec {
166166
@Test
167167
def memoize2: Unit = {
168168
val memoizedTime = Task
169-
.create[Long] { (sh, cb) =>
169+
.create[Long] { (_, cb) =>
170170
cb.onSuccess(System.currentTimeMillis())
171171
Cancelable.empty
172172
}

frontend/src/main/scala/bloop/bsp/BloopLanguageClient.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class BloopLanguageClient(
9090
for {
9191
id <- response match {
9292
case Response.None => Some(RequestId.Null)
93-
case Response.Success(_, requestId, jsonrpc, _) => Some(requestId)
94-
case Response.Error(_, requestId, jsonrpc, _) => Some(requestId)
93+
case Response.Success(_, requestId, _, _) => Some(requestId)
94+
case Response.Error(_, requestId, _, _) => Some(requestId)
9595
}
9696
callback <- activeServerRequests.remove(id).orElse {
9797
logger.error(s"Response to unknown request: $response")

frontend/src/main/scala/bloop/bsp/BloopRpcServices.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ object BloopRpcServices {
6161
import endpoint.{codecA, codecB}
6262
val method = endpoint.method
6363
message match {
64-
case Request(`method`, params, id, jsonrpc, headers) =>
64+
case Request(`method`, params, id, _, _) =>
6565
val paramsJson = extractJsonParams(params)
6666
Try(readFromArray[A](paramsJson.value)) match {
6767
case Success(value) =>
@@ -97,14 +97,14 @@ object BloopRpcServices {
9797
import endpoint.codecA
9898
val method = endpoint.method
9999
message match {
100-
case Notification(`method`, params, _, headers) =>
100+
case Notification(`method`, params, _, _) =>
101101
val paramsJson = extractJsonParams(params)
102102
Try(readFromArray[A](paramsJson.value)) match {
103-
case Success(value) => f(value).map(a => Response.None)
103+
case Success(value) => f(value).map(_ => Response.None)
104104
case Failure(err) =>
105105
fail(s"Failed to parse notification $message. Params: $paramsJson. Errors: $err")
106106
}
107-
case Notification(invalidMethod, _, _, headers) =>
107+
case Notification(invalidMethod, _, _, _) =>
108108
fail(s"Expected method '$method', obtained '$invalidMethod'")
109109
case _ => fail(s"Expected notification, obtained $message")
110110
}

0 commit comments

Comments
 (0)