diff --git a/mtags-shared/src/main/scala/scala/meta/internal/pc/CompilerAccess.scala b/mtags-shared/src/main/scala/scala/meta/internal/pc/CompilerAccess.scala index 89bdb1dc790..9111e94ed98 100644 --- a/mtags-shared/src/main/scala/scala/meta/internal/pc/CompilerAccess.scala +++ b/mtags-shared/src/main/scala/scala/meta/internal/pc/CompilerAccess.scala @@ -10,8 +10,12 @@ import java.util.logging.Logger import scala.concurrent.ExecutionContextExecutor import scala.util.control.NonFatal +import scala.meta.internal.metals.Report +import scala.meta.internal.metals.ReportContext import scala.meta.pc.CancelToken +import scala.meta.pc.OffsetParams import scala.meta.pc.PresentationCompilerConfig +import scala.meta.pc.VirtualFileParams /** * Manages the lifecycle and multi-threaded access to the presentation compiler. @@ -25,7 +29,7 @@ abstract class CompilerAccess[Reporter, Compiler]( sh: Option[ScheduledExecutorService], newCompiler: () => CompilerWrapper[Reporter, Compiler], shouldResetJobQueue: Boolean -)(implicit ec: ExecutionContextExecutor) { +)(implicit ec: ExecutionContextExecutor, rc: ReportContext) { private val logger: Logger = Logger.getLogger(classOf[CompilerAccess[_, _]].getName) @@ -76,7 +80,7 @@ abstract class CompilerAccess[Reporter, Compiler]( /** * Asynchronously execute a function on the compiler thread with `Thread.interrupt()` cancellation. */ - def withInterruptableCompiler[T]( + def withInterruptableCompiler[T](params: Option[VirtualFileParams])( default: T, token: CancelToken )(thunk: CompilerWrapper[Reporter, Compiler] => T): CompletableFuture[T] = { @@ -85,7 +89,7 @@ abstract class CompilerAccess[Reporter, Compiler]( val result = onCompilerJobQueue( () => { queueThread = Some(Thread.currentThread()) - try withSharedCompiler(default)(thunk) + try withSharedCompiler(params)(default)(thunk) finally isFinished.set(true) }, token @@ -119,10 +123,15 @@ abstract class CompilerAccess[Reporter, Compiler]( * Note that the function is still cancellable. */ def withNonInterruptableCompiler[T]( + params: Option[VirtualFileParams] + )( default: T, token: CancelToken )(thunk: CompilerWrapper[Reporter, Compiler] => T): CompletableFuture[T] = { - onCompilerJobQueue(() => withSharedCompiler(default)(thunk), token) + onCompilerJobQueue( + () => withSharedCompiler(params)(default)(thunk), + token + ) } /** @@ -130,7 +139,7 @@ abstract class CompilerAccess[Reporter, Compiler]( * * May potentially run in parallel with other requests, use carefully. */ - def withSharedCompiler[T]( + def withSharedCompiler[T](params: Option[VirtualFileParams])( default: T )(thunk: CompilerWrapper[Reporter, Compiler] => T): T = { try { @@ -141,14 +150,14 @@ abstract class CompilerAccess[Reporter, Compiler]( case other: Throwable => handleSharedCompilerException(other) .map { message => - retryWithCleanCompiler( + retryWithCleanCompiler(params)( thunk, default, message ) } .getOrElse { - handleError(other) + handleError(other, params) default } } @@ -159,6 +168,8 @@ abstract class CompilerAccess[Reporter, Compiler]( protected def ignoreException(t: Throwable): Boolean private def retryWithCleanCompiler[T]( + params: Option[VirtualFileParams] + )( thunk: CompilerWrapper[Reporter, Compiler] => T, default: T, cause: String @@ -173,14 +184,57 @@ abstract class CompilerAccess[Reporter, Compiler]( case InterruptException() => default case NonFatal(e) => - handleError(e) + handleError(e, params) default } } - private def handleError(e: Throwable): Unit = { - CompilerThrowable.trimStackTrace(e) - logger.log(Level.SEVERE, e.getMessage, e) + private def handleError( + e: Throwable, + params: Option[VirtualFileParams] + ): Unit = { + def virtualFileParamsToString(v: VirtualFileParams) = + s"""|file uri: ${v.uri()} + |file text: + |${v.text()} + |""".stripMargin + val stacktrace = Thread.currentThread().getStackTrace().mkString("\n") + val error = CompilerThrowable.trimStackTrace(e) + val paramsText = + params match { + case None => "" + case Some(r: RangeOffset) => + s"""|range ${r.start} - ${r.end} + |${virtualFileParamsToString(r)} + |""".stripMargin + case Some(o: OffsetParams) => + s"""|offset ${o.offset()} + |${virtualFileParamsToString(o)} + |""".stripMargin + case Some(v) => virtualFileParamsToString(v) + } + val pathToFull = + rc.unsanitized.create( + Report( + "compiler-error", + s"""|An error occurred in the presentation compiler: + |context stacktrace: + |${stacktrace} + |action params: + |$paramsText + |""".stripMargin, + error = Some(error) + ) + ) + pathToFull match { + case Some(path) => + logger.log( + Level.SEVERE, + s"A severe compiler error occurred, full details of the error can be found in the error report $path" + ) + case _ => + logger.log(Level.SEVERE, e.getMessage, e) + } shutdownCurrentCompiler() } diff --git a/mtags/src/main/scala-2/scala/meta/internal/pc/ScalaCompilerAccess.scala b/mtags/src/main/scala-2/scala/meta/internal/pc/ScalaCompilerAccess.scala index 078943eee34..0ea0737295b 100644 --- a/mtags/src/main/scala-2/scala/meta/internal/pc/ScalaCompilerAccess.scala +++ b/mtags/src/main/scala-2/scala/meta/internal/pc/ScalaCompilerAccess.scala @@ -7,6 +7,7 @@ import scala.tools.nsc.interactive.ShutdownReq import scala.tools.nsc.reporters.StoreReporter import scala.util.control.NonFatal +import scala.meta.internal.metals.ReportContext import scala.meta.pc.PresentationCompilerConfig class ScalaCompilerWrapper(global: MetalsGlobal) @@ -43,7 +44,7 @@ class ScalaCompilerAccess( config: PresentationCompilerConfig, sh: Option[ScheduledExecutorService], newCompiler: () => ScalaCompilerWrapper -)(implicit ec: ExecutionContextExecutor) +)(implicit ec: ExecutionContextExecutor, rc: ReportContext) extends CompilerAccess[StoreReporter, MetalsGlobal]( config, sh, diff --git a/mtags/src/main/scala-2/scala/meta/internal/pc/ScalaPresentationCompiler.scala b/mtags/src/main/scala-2/scala/meta/internal/pc/ScalaPresentationCompiler.scala index 6518974cb5e..5747b120294 100644 --- a/mtags/src/main/scala-2/scala/meta/internal/pc/ScalaPresentationCompiler.scala +++ b/mtags/src/main/scala-2/scala/meta/internal/pc/ScalaPresentationCompiler.scala @@ -19,6 +19,7 @@ import scala.tools.nsc.Settings import scala.tools.nsc.reporters.StoreReporter import scala.meta.internal.jdk.CollectionConverters._ +import scala.meta.internal.metals.CompilerVirtualFileParams import scala.meta.internal.metals.EmptyCancelToken import scala.meta.internal.metals.EmptyReportContext import scala.meta.internal.metals.ReportContext @@ -103,7 +104,8 @@ case class ScalaPresentationCompiler( sh, () => new ScalaCompilerWrapper(newCompiler()) )( - ec + ec, + reportContex ) override def shutdown(): Unit = { @@ -139,9 +141,8 @@ case class ScalaPresentationCompiler( override def semanticTokens( params: VirtualFileParams ): CompletableFuture[ju.List[Node]] = { - val empty: ju.List[Node] = new ju.ArrayList[Node]() - compilerAccess.withInterruptableCompiler( + compilerAccess.withInterruptableCompiler(Some(params))( empty, params.token ) { pc => @@ -155,7 +156,7 @@ case class ScalaPresentationCompiler( override def complete( params: OffsetParams ): CompletableFuture[CompletionList] = - compilerAccess.withInterruptableCompiler( + compilerAccess.withInterruptableCompiler(Some(params))( EmptyCompletionList(), params.token ) { pc => @@ -166,7 +167,10 @@ case class ScalaPresentationCompiler( params: OffsetParams ): CompletableFuture[ju.List[TextEdit]] = { val empty: ju.List[TextEdit] = new ju.ArrayList[TextEdit]() - compilerAccess.withInterruptableCompiler(empty, params.token) { pc => + compilerAccess.withInterruptableCompiler(Some(params))( + empty, + params.token + ) { pc => new CompletionProvider(pc.compiler(), params).implementAll() } } @@ -175,7 +179,10 @@ case class ScalaPresentationCompiler( params: OffsetParams ): CompletableFuture[ju.List[TextEdit]] = { val empty: ju.List[TextEdit] = new ju.ArrayList[TextEdit]() - compilerAccess.withInterruptableCompiler(empty, params.token) { pc => + compilerAccess.withInterruptableCompiler(Some(params))( + empty, + params.token + ) { pc => new InferredTypeProvider(pc.compiler(), params).inferredTypeEdits().asJava } } @@ -185,7 +192,7 @@ case class ScalaPresentationCompiler( ): CompletableFuture[ju.List[TextEdit]] = { val empty: Either[String, List[TextEdit]] = Right(List()) (compilerAccess - .withInterruptableCompiler(empty, params.token) { pc => + .withInterruptableCompiler(Some(params))(empty, params.token) { pc => new PcInlineValueProviderImpl(pc.compiler(), params).getInlineTextEdits }) .thenApply { @@ -199,12 +206,13 @@ case class ScalaPresentationCompiler( extractionPos: OffsetParams ): CompletableFuture[ju.List[TextEdit]] = { val empty: ju.List[TextEdit] = new ju.ArrayList[TextEdit]() - compilerAccess.withInterruptableCompiler(empty, range.token) { pc => - new ExtractMethodProvider( - pc.compiler(), - range, - extractionPos - ).extractMethod.asJava + compilerAccess.withInterruptableCompiler(Some(range))(empty, range.token) { + pc => + new ExtractMethodProvider( + pc.compiler(), + range, + extractionPos + ).extractMethod.asJava } } @@ -214,7 +222,7 @@ case class ScalaPresentationCompiler( ): CompletableFuture[ju.List[TextEdit]] = { val empty: Either[String, List[TextEdit]] = Right(List()) (compilerAccess - .withInterruptableCompiler(empty, params.token) { pc => + .withInterruptableCompiler(Some(params))(empty, params.token) { pc => new ConvertToNamedArgumentsProvider( pc.compiler(), params, @@ -232,7 +240,7 @@ case class ScalaPresentationCompiler( params: OffsetParams, isExtension: java.lang.Boolean // ignore, because Scala2 doesn't support extension method ): CompletableFuture[ju.List[AutoImportsResult]] = - compilerAccess.withInterruptableCompiler( + compilerAccess.withInterruptableCompiler(Some(params))( List.empty[AutoImportsResult].asJava, params.token ) { pc => @@ -254,7 +262,7 @@ case class ScalaPresentationCompiler( symbol: String ): CompletableFuture[CompletionItem] = CompletableFuture.completedFuture { - compilerAccess.withSharedCompiler(item) { pc => + compilerAccess.withSharedCompiler(None)(item) { pc => new CompletionItemResolver(pc.compiler()).resolve(item, symbol) } } @@ -262,7 +270,7 @@ case class ScalaPresentationCompiler( override def signatureHelp( params: OffsetParams ): CompletableFuture[SignatureHelp] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( new SignatureHelp(), params.token ) { pc => new SignatureHelpProvider(pc.compiler()).signatureHelp(params) } @@ -270,7 +278,7 @@ case class ScalaPresentationCompiler( override def prepareRename( params: OffsetParams ): CompletableFuture[ju.Optional[Range]] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( Optional.empty[Range](), params.token ) { pc => @@ -281,7 +289,7 @@ case class ScalaPresentationCompiler( params: OffsetParams, name: String ): CompletableFuture[ju.List[TextEdit]] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( List[TextEdit]().asJava, params.token ) { pc => @@ -291,7 +299,7 @@ case class ScalaPresentationCompiler( override def hover( params: OffsetParams ): CompletableFuture[Optional[HoverSignature]] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( Optional.empty[HoverSignature](), params.token ) { pc => @@ -301,7 +309,7 @@ case class ScalaPresentationCompiler( } def definition(params: OffsetParams): CompletableFuture[DefinitionResult] = { - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( DefinitionResultImpl.empty, params.token ) { pc => new PcDefinitionProvider(pc.compiler(), params).definition() } @@ -310,7 +318,7 @@ case class ScalaPresentationCompiler( override def typeDefinition( params: OffsetParams ): CompletableFuture[DefinitionResult] = { - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( DefinitionResultImpl.empty, params.token ) { pc => new PcDefinitionProvider(pc.compiler(), params).typeDefinition() } @@ -319,7 +327,7 @@ case class ScalaPresentationCompiler( override def documentHighlight( params: OffsetParams ): CompletableFuture[util.List[DocumentHighlight]] = - compilerAccess.withInterruptableCompiler( + compilerAccess.withInterruptableCompiler(Some(params))( List.empty[DocumentHighlight].asJava, params.token() ) { pc => @@ -327,10 +335,11 @@ case class ScalaPresentationCompiler( } override def semanticdbTextDocument( - uri: URI, + fileUri: URI, code: String ): CompletableFuture[Array[Byte]] = { - compilerAccess.withInterruptableCompiler( + val virtualFile = CompilerVirtualFileParams(fileUri, code) + compilerAccess.withInterruptableCompiler(Some(virtualFile))( Array.emptyByteArray, EmptyCancelToken ) { pc => @@ -338,7 +347,7 @@ case class ScalaPresentationCompiler( pc.compiler(), config.semanticdbCompilerOptions().asScala.toList ) - .textDocument(uri, code) + .textDocument(fileUri, code) .toByteArray } } @@ -347,11 +356,12 @@ case class ScalaPresentationCompiler( params: ju.List[OffsetParams] ): CompletableFuture[ju.List[SelectionRange]] = { CompletableFuture.completedFuture { - compilerAccess.withSharedCompiler(List.empty[SelectionRange].asJava) { - pc => - new SelectionRangeProvider(pc.compiler(), params) - .selectionRange() - .asJava + compilerAccess.withSharedCompiler(params.asScala.headOption)( + List.empty[SelectionRange].asJava + ) { pc => + new SelectionRangeProvider(pc.compiler(), params) + .selectionRange() + .asJava } } } diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/Scala3CompilerAccess.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/Scala3CompilerAccess.scala index 7348fea2d64..56a46ff4a03 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/Scala3CompilerAccess.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/Scala3CompilerAccess.scala @@ -4,6 +4,7 @@ import java.util.concurrent.ScheduledExecutorService import scala.concurrent.ExecutionContextExecutor +import scala.meta.internal.metals.ReportContext import scala.meta.pc.PresentationCompilerConfig import dotty.tools.dotc.reporting.StoreReporter @@ -12,7 +13,7 @@ class Scala3CompilerAccess( config: PresentationCompilerConfig, sh: Option[ScheduledExecutorService], newCompiler: () => Scala3CompilerWrapper, -)(using ec: ExecutionContextExecutor) +)(using ec: ExecutionContextExecutor, rc: ReportContext) extends CompilerAccess[StoreReporter, MetalsDriver]( config, sh, diff --git a/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala b/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala index ef91a612de3..b92ca56db8b 100644 --- a/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala +++ b/mtags/src/main/scala-3/scala/meta/internal/pc/ScalaPresentationCompiler.scala @@ -13,6 +13,7 @@ import scala.collection.JavaConverters.* import scala.concurrent.ExecutionContext import scala.concurrent.ExecutionContextExecutor +import scala.meta.internal.metals.CompilerVirtualFileParams import scala.meta.internal.metals.EmptyCancelToken import scala.meta.internal.metals.EmptyReportContext import scala.meta.internal.metals.ReportContext @@ -86,7 +87,7 @@ case class ScalaPresentationCompiler( override def semanticTokens( params: VirtualFileParams ): CompletableFuture[ju.List[Node]] = - compilerAccess.withInterruptableCompiler( + compilerAccess.withInterruptableCompiler(Some(params))( new ju.ArrayList[Node](), params.token(), ) { access => @@ -103,7 +104,7 @@ case class ScalaPresentationCompiler( } def complete(params: OffsetParams): CompletableFuture[l.CompletionList] = - compilerAccess.withInterruptableCompiler( + compilerAccess.withInterruptableCompiler(Some(params))( EmptyCompletionList(), params.token, ) { access => @@ -120,7 +121,7 @@ case class ScalaPresentationCompiler( } def definition(params: OffsetParams): CompletableFuture[DefinitionResult] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( DefinitionResultImpl.empty, params.token, ) { access => @@ -131,7 +132,7 @@ case class ScalaPresentationCompiler( override def typeDefinition( params: OffsetParams ): CompletableFuture[DefinitionResult] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( DefinitionResultImpl.empty, params.token, ) { access => @@ -142,7 +143,7 @@ case class ScalaPresentationCompiler( def documentHighlight( params: OffsetParams ): CompletableFuture[ju.List[DocumentHighlight]] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( List.empty[DocumentHighlight].asJava, params.token, ) { access => @@ -163,7 +164,8 @@ case class ScalaPresentationCompiler( filename: URI, code: String, ): CompletableFuture[Array[Byte]] = - compilerAccess.withNonInterruptableCompiler( + val virtualFile = CompilerVirtualFileParams(filename, code) + compilerAccess.withNonInterruptableCompiler(Some(virtualFile))( Array.empty[Byte], EmptyCancelToken, ) { access => @@ -171,12 +173,13 @@ case class ScalaPresentationCompiler( val provider = SemanticdbTextDocumentProvider(driver, folderPath) provider.textDocument(filename, code) } + end semanticdbTextDocument def completionItemResolve( item: l.CompletionItem, symbol: String, ): CompletableFuture[l.CompletionItem] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(None)( item, EmptyCancelToken, ) { access => @@ -193,7 +196,7 @@ case class ScalaPresentationCompiler( ): CompletableFuture[ ju.List[scala.meta.pc.AutoImportsResult] ] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( List.empty[scala.meta.pc.AutoImportsResult].asJava, params.token, ) { access => @@ -214,7 +217,10 @@ case class ScalaPresentationCompiler( params: OffsetParams ): CompletableFuture[ju.List[l.TextEdit]] = val empty: ju.List[l.TextEdit] = new ju.ArrayList[l.TextEdit]() - compilerAccess.withInterruptableCompiler(empty, params.token) { pc => + compilerAccess.withInterruptableCompiler(Some(params))( + empty, + params.token, + ) { pc => val driver = pc.compiler() OverrideCompletions.implementAllAt( params, @@ -229,7 +235,10 @@ case class ScalaPresentationCompiler( params: OffsetParams ): CompletableFuture[ju.List[l.TextEdit]] = val empty: ju.List[l.TextEdit] = new ju.ArrayList[l.TextEdit]() - compilerAccess.withInterruptableCompiler(empty, params.token) { pc => + compilerAccess.withInterruptableCompiler(Some(params))( + empty, + params.token, + ) { pc => new InferredTypeProvider(params, pc.compiler(), config, search) .inferredTypeEdits() .asJava @@ -240,7 +249,10 @@ case class ScalaPresentationCompiler( ): CompletableFuture[ju.List[l.TextEdit]] = val empty: Either[String, List[l.TextEdit]] = Right(List()) (compilerAccess - .withInterruptableCompiler(empty, params.token) { pc => + .withInterruptableCompiler(Some(params))( + empty, + params.token, + ) { pc => new PcInlineValueProviderImpl(pc.compiler(), params) .getInlineTextEdits() }) @@ -255,16 +267,17 @@ case class ScalaPresentationCompiler( extractionPos: OffsetParams, ): CompletableFuture[ju.List[l.TextEdit]] = val empty: ju.List[l.TextEdit] = new ju.ArrayList[l.TextEdit]() - compilerAccess.withInterruptableCompiler(empty, range.token) { pc => - new ExtractMethodProvider( - range, - extractionPos, - pc.compiler(), - search, - options.contains("-no-indent"), - ) - .extractMethod() - .asJava + compilerAccess.withInterruptableCompiler(Some(range))(empty, range.token) { + pc => + new ExtractMethodProvider( + range, + extractionPos, + pc.compiler(), + search, + options.contains("-no-indent"), + ) + .extractMethod() + .asJava } end extractMethod @@ -274,7 +287,7 @@ case class ScalaPresentationCompiler( ): CompletableFuture[ju.List[l.TextEdit]] = val empty: Either[String, List[l.TextEdit]] = Right(List()) (compilerAccess - .withInterruptableCompiler(empty, params.token) { pc => + .withInterruptableCompiler(Some(params))(empty, params.token) { pc => new ConvertToNamedArgumentsProvider( pc.compiler(), params, @@ -290,12 +303,13 @@ case class ScalaPresentationCompiler( params: ju.List[OffsetParams] ): CompletableFuture[ju.List[l.SelectionRange]] = CompletableFuture.completedFuture { - compilerAccess.withSharedCompiler(List.empty[l.SelectionRange].asJava) { - pc => - new SelectionRangeProvider( - pc.compiler(), - params, - ).selectionRange().asJava + compilerAccess.withSharedCompiler(params.asScala.headOption)( + List.empty[l.SelectionRange].asJava + ) { pc => + new SelectionRangeProvider( + pc.compiler(), + params, + ).selectionRange().asJava } } end selectionRange @@ -303,7 +317,7 @@ case class ScalaPresentationCompiler( def hover( params: OffsetParams ): CompletableFuture[ju.Optional[HoverSignature]] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( ju.Optional.empty[HoverSignature](), params.token, ) { access => @@ -315,7 +329,7 @@ case class ScalaPresentationCompiler( def prepareRename( params: OffsetParams ): CompletableFuture[ju.Optional[l.Range]] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( Optional.empty[l.Range](), params.token, ) { access => @@ -329,7 +343,7 @@ case class ScalaPresentationCompiler( params: OffsetParams, name: String, ): CompletableFuture[ju.List[l.TextEdit]] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( List[l.TextEdit]().asJava, params.token, ) { access => @@ -349,7 +363,7 @@ case class ScalaPresentationCompiler( ) def signatureHelp(params: OffsetParams): CompletableFuture[l.SignatureHelp] = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(Some(params))( new l.SignatureHelp(), params.token, ) { access => @@ -363,7 +377,7 @@ case class ScalaPresentationCompiler( CompletableFuture.completedFuture(Nil.asJava) override def didClose(uri: URI): Unit = - compilerAccess.withNonInterruptableCompiler( + compilerAccess.withNonInterruptableCompiler(None)( (), EmptyCancelToken, ) { access => access.compiler().close(uri) }