@@ -6,8 +6,10 @@ import dotty.tools.pc.ScalaPresentationCompiler
66import org .junit .{Before , Test }
77
88import scala .language .unsafeNulls
9- import scala .meta .internal .metals .EmptyCancelToken
109import 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
1113import scala .meta .pc .OffsetParams
1214import scala .concurrent .Future
1315import 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