Skip to content

Commit dbd8def

Browse files
committed
Provide context to SourceFile in scaldoc
1 parent f953bfe commit dbd8def

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scaladoc/src/dotty/tools/scaladoc/site/templates.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ case class TemplateFile(
8080
lazy val snippetCheckingFunc: SnippetChecker.SnippetCheckingFunc =
8181
val path = Some(Paths.get(file.getAbsolutePath))
8282
val pathBasedArg = ssctx.snippetCompilerArgs.get(path)
83-
val sourceFile = dotty.tools.dotc.util.SourceFile(dotty.tools.io.AbstractFile.getFile(path.get), scala.io.Codec.UTF8)
83+
val initDottyContext = (new dotty.tools.dotc.core.Contexts.ContextBase).initialCtx
84+
val sourceFile = dotty.tools.dotc.util.SourceFile(dotty.tools.io.AbstractFile.getFile(path.get), scala.io.Codec.UTF8)(using initDottyContext)
8485
(str: String, lineOffset: SnippetChecker.LineOffset, argOverride: Option[SCFlags]) => {
8586
val arg = argOverride.fold(pathBasedArg)(pathBasedArg.overrideFlag(_))
8687
val compilerData = SnippetCompilerData(

0 commit comments

Comments
 (0)