@@ -58,12 +58,18 @@ abstract class BspTestDefinitions(val scalaVersionOpt: Option[String])
58
58
}
59
59
60
60
def withBsp [T ](
61
- root : os. Path ,
61
+ inputs : TestInputs ,
62
62
args : Seq [String ]
63
63
)(
64
- f : (TestBspClient , b.BuildServer with b.ScalaBuildServer with b.JavaBuildServer ) => Future [T ]
64
+ f : (
65
+ os.Path ,
66
+ TestBspClient ,
67
+ b.BuildServer with b.ScalaBuildServer with b.JavaBuildServer
68
+ ) => Future [T ]
65
69
): T = {
66
70
71
+ val root = inputs.root()
72
+
67
73
val proc = os.proc(TestUtil .cli, " bsp" , extraOptions, args)
68
74
.spawn(cwd = root)
69
75
var remoteServer : b.BuildServer with b.ScalaBuildServer with b.JavaBuildServer = null
@@ -73,7 +79,7 @@ abstract class BspTestDefinitions(val scalaVersionOpt: Option[String])
73
79
TestBspClient .connect(proc.stdout, proc.stdin, pool)
74
80
remoteServer = remoteServer0
75
81
Await .result(remoteServer.buildInitialize(initParams(root)).asScala, 3 .minutes)
76
- Await .result(f(localClient, remoteServer), 3 .minutes)
82
+ Await .result(f(root, localClient, remoteServer), 3 .minutes)
77
83
}
78
84
finally {
79
85
if (remoteServer != null )
@@ -132,9 +138,8 @@ abstract class BspTestDefinitions(val scalaVersionOpt: Option[String])
132
138
| """ .stripMargin
133
139
)
134
140
)
135
- val root = inputs.root()
136
141
137
- withBsp(root , Seq (" ." )) { (localClient, remoteServer) =>
142
+ withBsp(inputs , Seq (" ." )) { (root, localClient, remoteServer) =>
138
143
async {
139
144
val buildTargetsResp = await(remoteServer.workspaceBuildTargets().asScala)
140
145
val target = {
@@ -260,9 +265,8 @@ abstract class BspTestDefinitions(val scalaVersionOpt: Option[String])
260
265
| """ .stripMargin
261
266
)
262
267
)
263
- val root = inputs.root()
264
268
265
- withBsp(root , Seq (" ." )) { (localClient, remoteServer) =>
269
+ withBsp(inputs , Seq (" ." )) { (root, localClient, remoteServer) =>
266
270
async {
267
271
val buildTargetsResp = await(remoteServer.workspaceBuildTargets().asScala)
268
272
val target = {
@@ -328,9 +332,8 @@ abstract class BspTestDefinitions(val scalaVersionOpt: Option[String])
328
332
| """ .stripMargin
329
333
)
330
334
)
331
- val root = inputs.root()
332
335
333
- withBsp(root , Seq (" ." )) { (localClient, remoteServer) =>
336
+ withBsp(inputs , Seq (" ." )) { (root, localClient, remoteServer) =>
334
337
async {
335
338
val buildTargetsResp = await(remoteServer.workspaceBuildTargets().asScala)
336
339
val target = {
@@ -397,12 +400,11 @@ abstract class BspTestDefinitions(val scalaVersionOpt: Option[String])
397
400
| """ .stripMargin
398
401
)
399
402
)
400
- val root = inputs.root()
401
-
402
403
val extraArgs =
403
404
if (Properties .isWin) Seq (" -v" , " -v" , " -v" )
404
405
else Nil
405
- withBsp(root, Seq (" ." ) ++ extraArgs) { (localClient, remoteServer) =>
406
+
407
+ withBsp(inputs, Seq (" ." ) ++ extraArgs) { (root, localClient, remoteServer) =>
406
408
async {
407
409
val buildTargetsResp = await(remoteServer.workspaceBuildTargets().asScala)
408
410
val target = {
@@ -515,9 +517,8 @@ abstract class BspTestDefinitions(val scalaVersionOpt: Option[String])
515
517
| """ .stripMargin
516
518
)
517
519
)
518
- val root = inputs.root()
519
520
520
- withBsp(root , Seq (" ." )) { (localClient, remoteServer) =>
521
+ withBsp(inputs , Seq (" ." )) { (root, localClient, remoteServer) =>
521
522
async {
522
523
val buildTargetsResp = await(remoteServer.workspaceBuildTargets().asScala)
523
524
val target = {
0 commit comments