Skip to content

Commit bcb38be

Browse files
committed
Update CompilerCachingSuite.scala
1 parent c2f6143 commit bcb38be

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

presentation-compiler/test/dotty/tools/pc/tests/CompilerCachingSuite.scala

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@ import dotty.tools.pc.ScalaPresentationCompiler
66
import org.junit.{Before, Test}
77

88
import scala.language.unsafeNulls
9-
import scala.meta.internal.metals.EmptyCancelToken
109
import scala.meta.internal.metals.CompilerOffsetParams
10+
import scala.meta.internal.metals.EmptyCancelToken
11+
import scala.meta.internal.metals.EmptyReportContext
12+
import scala.meta.internal.metals.PcQueryContext
1113
import scala.meta.pc.OffsetParams
1214
import scala.concurrent.Future
1315
import scala.concurrent.Await
@@ -26,20 +28,22 @@ class CompilerCachingSuite extends BasePCSuite:
2628
private def checkCompilationCount(expected: Int): Unit =
2729
presentationCompiler match
2830
case pc: ScalaPresentationCompiler =>
29-
val compilations = pc.compilerAccess.withNonInterruptableCompiler(None)(-1, EmptyCancelToken) { driver =>
31+
val compilations = pc.compilerAccess.withNonInterruptableCompiler(-1, EmptyCancelToken) { driver =>
3032
driver.compiler().currentCtx.runId
31-
}.get(timeout.length, timeout.unit)
33+
}(emptyQueryContext).get(timeout.length, timeout.unit)
3234
assertEquals(expected, compilations, s"Expected $expected compilations but got $compilations")
3335
case _ => throw IllegalStateException("Presentation compiler should always be of type of ScalaPresentationCompiler")
3436

3537
private def getContext(): Context =
3638
presentationCompiler match
3739
case pc: ScalaPresentationCompiler =>
38-
pc.compilerAccess.withNonInterruptableCompiler(None)(null, EmptyCancelToken) { driver =>
40+
pc.compilerAccess.withNonInterruptableCompiler(null, EmptyCancelToken) { driver =>
3941
driver.compiler().currentCtx
40-
}.get(timeout.length, timeout.unit)
42+
}(emptyQueryContext).get(timeout.length, timeout.unit)
4143
case _ => throw IllegalStateException("Presentation compiler should always be of type of ScalaPresentationCompiler")
4244

45+
private def emptyQueryContext = PcQueryContext(None, () => "")(using EmptyReportContext)
46+
4347
@Before
4448
def beforeEach: Unit =
4549
presentationCompiler.restart()

0 commit comments

Comments
 (0)