@@ -49,7 +49,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
4949 // Just turn off another translator since multiple overrides does not work
5050 val disableDescriptorTranslator = extend(
5151 _.extensionPoint(CoreExtensions .INSTANCE .getSourceToDocumentableTranslator)
52- .fromRecipe( ctx => new ScalaModuleProvider ( using ctx.config.docContext))
52+ .fromRecipe { case ctx as given DokkaContext => new ScalaModuleProvider }
5353 .overrideExtension(dokkaBase.getDescriptorToDocumentableTranslator)
5454 .name(" disableDescriptorTranslator" )
5555 )
@@ -63,14 +63,14 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
6363
6464 val ourSignatureProvider = extend(
6565 _.extensionPoint(dokkaBase.getSignatureProvider)
66- .fromRecipe( ctx =>
67- new ScalaSignatureProvider (ctx.single(dokkaBase.getCommentsToContentConverter), ctx.getLogger )
68- ) .overrideExtension(dokkaBase.getKotlinSignatureProvider)
66+ .fromRecipe{ case ctx as given DokkaContext =>
67+ new ScalaSignatureProvider (ctx.single(dokkaBase.getCommentsToContentConverter))
68+ } .overrideExtension(dokkaBase.getKotlinSignatureProvider)
6969 )
7070
7171 val scalaResourceInstaller = extend(
7272 _.extensionPoint(dokkaBase.getHtmlPreprocessors)
73- .fromRecipe( ctx => new ScalaResourceInstaller (ctx.config.args))
73+ .fromRecipe{ case ctx as given DokkaContext => new ScalaResourceInstaller }
7474 .after(dokkaBase.getCustomResourceInstaller)
7575 )
7676
@@ -83,17 +83,14 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
8383
8484 val scalaDocumentableToPageTranslator = extend(
8585 _.extensionPoint(CoreExtensions .INSTANCE .getDocumentableToPageTranslator)
86- .fromRecipe( ctx =>
86+ .fromRecipe { case ctx as given DokkaContext =>
8787 new DocumentableToPageTranslator {
8888 override def invoke (module : DModule ): ModulePageNode = ScalaPageCreator (
8989 ctx.single(dokkaBase.getCommentsToContentConverter),
90- ctx.single(dokkaBase.getSignatureProvider),
91- ctx.getConfiguration.asInstanceOf [DottyDokkaConfig ].sourceLinks,
92- ctx.getLogger
90+ ctx.single(dokkaBase.getSignatureProvider)
9391 ).pageForModule(module)
9492 }
95- )
96- .overrideExtension(dokkaBase.getDocumentableToPageTranslator)
93+ }.overrideExtension(dokkaBase.getDocumentableToPageTranslator)
9794 )
9895
9996 val packageHierarchyTransformer = extend(
@@ -111,7 +108,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
111108
112109 val ourRenderer = extend(
113110 _.extensionPoint(CoreExtensions .INSTANCE .getRenderer)
114- .fromRecipe( ctx => ScalaHtmlRenderer (ctx, ctx.config.args))
111+ .fromRecipe { case ctx as given DokkaContext => new ScalaHtmlRenderer }
115112 .overrideExtension(dokkaBase.getHtmlRenderer)
116113 )
117114
@@ -129,7 +126,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
129126
130127 val customDocumentationProvider = extend(
131128 _.extensionPoint(dokkaBase.getHtmlPreprocessors)
132- .fromRecipe(c => SitePagesCreator (c.config.staticSiteContext))
129+ .fromRecipe{ case c as given DokkaContext => new SitePagesCreator }
133130 .name(" customDocumentationProvider" )
134131 .ordered(
135132 before = Seq (
@@ -144,7 +141,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
144141
145142 val customNavigation = extend(
146143 _.extensionPoint(dokkaBase.getHtmlPreprocessors)
147- .fromRecipe(c => NavigationCreator (c.config)) // Adding a parameter to constuctor to NavigationCreator failed inc compilation
144+ .fromRecipe{ case c as given DokkaContext => new NavigationCreator }
148145 .name(" customNavigation" )
149146 .ordered(
150147 before = Seq (
@@ -158,7 +155,7 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
158155
159156 val customDocumentationResources = extend(
160157 _.extensionPoint(dokkaBase.getHtmlPreprocessors)
161- .fromRecipe(c => SiteResourceManager (c.config.staticSiteContext))
158+ .fromRecipe{ case c as given DokkaContext => new SiteResourceManager }
162159 .name(" customDocumentationResources" )
163160 .after(
164161 scalaEmbeddedResourceAppender.getValue,
@@ -168,13 +165,10 @@ class DottyDokkaPlugin extends DokkaJavaPlugin:
168165
169166 val locationProvider = extend(
170167 _.extensionPoint(dokkaBase.getLocationProviderFactory)
171- .fromRecipe( StaticSiteLocationProviderFactory (_))
168+ .fromRecipe { case c as given DokkaContext => new StaticSiteLocationProviderFactory }
172169 .overrideExtension(dokkaBase.getLocationProvider)
173170 )
174171
175- extension (ctx : DokkaContext ):
176- def config = ctx.getConfiguration.asInstanceOf [DottyDokkaConfig ]
177-
178172// TODO (https://github.com/lampepfl/scala3doc/issues/232): remove once problem is fixed in Dokka
179173extension [T ] (builder : ExtensionBuilder [T ]):
180174 def ordered (before : Seq [Extension [_, _, _]], after : Seq [Extension [_, _, _]]): ExtensionBuilder [T ] =
0 commit comments