diff options
author | Vsevolod Tolstopyatov <qwwdfsad@gmail.com> | 2023-08-14 19:45:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-14 19:45:32 +0200 |
commit | 2269ac5e003b1cce90742b5f5ed9cd294dd099f4 (patch) | |
tree | b90bdab54c9ce0b144ed4485905e5257f174a58b /plugins/base/src/main/kotlin/resolvers | |
parent | 2fd8e9096706545f8b77e1e66bcc876d7e29f82c (diff) | |
download | dokka-2269ac5e003b1cce90742b5f5ed9cd294dd099f4.tar.gz dokka-2269ac5e003b1cce90742b5f5ed9cd294dd099f4.tar.bz2 dokka-2269ac5e003b1cce90742b5f5ed9cd294dd099f4.zip |
Refactor and document DisplaySourceSet, deprecate SelfRepresentingSingletonSet (#3105)
* Deprecate internal API SelfRepresentingSingletonSet for removal as being harmful and unimplement it in DisplaySourceSet
* Provide no automatic migration for DisplaySourceSet, as there are no mechanisms for that. Manual migration is the replacement of 'dss' to `setOf(dss)` where applicable
* Introduce a convenience-member DefaultRenderer.buildContentNode to avoid wrapping DSS into set manually
* Document DisplaySourceSet
* Replace Iterable<DisplaySourceSet>.sourceSetIDs with more straightforward Iterable<DisplaySourceSet>.computeSourceSetIds(), refactor all the usages, save some allocations
* Start caching CompositeSourceSetID properties to avoid excessive allocations
* Update integration tests on the latest revision with Knit version where the workaround is applied
Fixes #2897
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers')
-rw-r--r-- | plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt index 4934e8f4..1c7ffe14 100644 --- a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt +++ b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt @@ -4,10 +4,7 @@ import org.jetbrains.dokka.base.renderers.sourceSets import org.jetbrains.dokka.base.resolvers.anchors.SymbolAnchorHint import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.PointingToDeclaration -import org.jetbrains.dokka.model.DisplaySourceSet -import org.jetbrains.dokka.model.sourceSetIDs -import org.jetbrains.dokka.model.toDisplaySourceSet -import org.jetbrains.dokka.model.withDescendants +import org.jetbrains.dokka.model.* import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import java.util.* @@ -91,12 +88,12 @@ open class DokkaLocationProvider( val (dri, originalSourceSet) = driWithSourceSets val allSourceSets: List<Set<DisplaySourceSet>> = listOf(originalSourceSet) + originalSourceSet.let { oss -> - dokkaContext.configuration.sourceSets.filter { it.sourceSetID in oss.sourceSetIDs } + val ossIds = oss.computeSourceSetIds() + dokkaContext.configuration.sourceSets.filter { it.sourceSetID in ossIds } .flatMap { it.dependentSourceSets } .mapNotNull { ssid -> dokkaContext.configuration.sourceSets.find { it.sourceSetID == ssid }?.toDisplaySourceSet() }.map { - // be careful `data DisplaySourceSet: Set<DisplaySourceSet>` but `setOf(someDisplaySourceSet) != someDisplaySourceSet` setOf(it) } } |