diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-06-19 14:08:49 +0200 |
---|---|---|
committer | Paweł Marks <pmarks@virtuslab.com> | 2020-06-25 20:23:58 +0200 |
commit | 8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f (patch) | |
tree | fe4e24d9f352199e551bd34ba330c0d2c0acf7af /plugins/base/src/main/kotlin/signatures | |
parent | 08f40e2a13006882e8f8425f111b8527e7bbcb0f (diff) | |
download | dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.tar.gz dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.tar.bz2 dokka-8cb6efc97f8fa321381c95cc5f85a3ce7bc13c3f.zip |
Remove SourceSetDataCache, rename PassConfiguration to DokkaSourceSet and use it instead of SourceSetData
Diffstat (limited to 'plugins/base/src/main/kotlin/signatures')
-rw-r--r-- | plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt | 12 | ||||
-rw-r--r-- | plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt | 16 |
2 files changed, 16 insertions, 12 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt index 8dbe7b12..f042eae3 100644 --- a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt +++ b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt @@ -1,10 +1,12 @@ package org.jetbrains.dokka.base.signatures +import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.* +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet interface JvmSignatureUtils { @@ -73,7 +75,7 @@ interface JvmSignatureUtils { is All -> All is Never, is OnlyOnce -> Never }.let { strategy -> - valueToSignature(it.value, strategy, listBrackets, classExtension) + valueToSignature(it.value, strategy, listBrackets, classExtension) } if (i != a.params.entries.size - 1) text(", ") } @@ -130,11 +132,11 @@ interface JvmSignatureUtils { } } - fun <T : Documentable> WithExtraProperties<T>.stylesIfDeprecated(sourceSetData: SourceSetData): Set<TextStyle> = + fun <T : Documentable> WithExtraProperties<T>.stylesIfDeprecated(sourceSetData: DokkaSourceSet): Set<TextStyle> = if (extra[Annotations]?.content?.get(sourceSetData)?.any { - it.dri == DRI("kotlin", "Deprecated") - || it.dri == DRI("java.lang", "Deprecated") - } == true) setOf(TextStyle.Strikethrough) else emptySet() + it.dri == DRI("kotlin", "Deprecated") + || it.dri == DRI("java.lang", "Deprecated") + } == true) setOf(TextStyle.Strikethrough) else emptySet() } sealed class AtStrategy diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index 3e92b902..28c26dea 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka.base.signatures +import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder @@ -24,7 +25,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog ExtraModifiers.KotlinOnlyModifiers.TailRec, ExtraModifiers.KotlinOnlyModifiers.External ) - private val platformSpecificModifiers : Map<ExtraModifiers, Set<Platform>> = mapOf( + private val platformSpecificModifiers: Map<ExtraModifiers, Set<Platform>> = mapOf( ExtraModifiers.KotlinOnlyModifiers.External to setOf(Platform.js) ) @@ -40,13 +41,14 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog ) } - private fun <T> PageContentBuilder.DocumentableContentBuilder.processExtraModifiers (t: T) - where T: Documentable, T: WithExtraProperties<T> { + private fun <T> PageContentBuilder.DocumentableContentBuilder.processExtraModifiers(t: T) + where T : Documentable, T : WithExtraProperties<T> { sourceSetDependentText( t.modifiers() .mapValues { entry -> entry.value.filter { - it !in ignoredExtraModifiers || entry.key.platform in (platformSpecificModifiers[it] ?: emptySet()) + it !in ignoredExtraModifiers || entry.key.analysisPlatform in (platformSpecificModifiers[it] + ?: emptySet()) } } ) { @@ -73,7 +75,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog } } - private fun actualTypealiasedSignature(c: DClasslike, sourceSet: SourceSetData, aliasedType: Bound) = + private fun actualTypealiasedSignature(c: DClasslike, sourceSet: DokkaSourceSet, aliasedType: Bound) = contentBuilder.contentFor( c, ContentKind.Symbol, @@ -97,7 +99,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog } - private fun regularSignature(c: DClasslike, sourceSet: SourceSetData) = + private fun regularSignature(c: DClasslike, sourceSet: DokkaSourceSet) = contentBuilder.contentFor( c, ContentKind.Symbol, @@ -315,7 +317,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog is UnresolvedBound -> text(p.name) } - private fun funType(dri: DRI, sourceSets: Set<SourceSetData>, type: TypeConstructor) = + private fun funType(dri: DRI, sourceSets: Set<DokkaSourceSet>, type: TypeConstructor) = contentBuilder.contentFor(dri, sourceSets, ContentKind.Main) { if (type.extension) { signatureForProjection(type.projections.first()) |