aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/model/documentableUtils.kt
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2020-05-05 17:45:12 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-05-14 13:30:33 +0200
commit3f2a790190da4f40ea6d8a976aa1929b2a1b002b (patch)
tree752ee84451954e9ea5e6d4133e18e41aaee2f7b1 /core/src/main/kotlin/model/documentableUtils.kt
parenta440f0cb8756019131a2c15389e747aea3c585e7 (diff)
downloaddokka-3f2a790190da4f40ea6d8a976aa1929b2a1b002b.tar.gz
dokka-3f2a790190da4f40ea6d8a976aa1929b2a1b002b.tar.bz2
dokka-3f2a790190da4f40ea6d8a976aa1929b2a1b002b.zip
Changing approach from platform-driven to source-set-driven
Diffstat (limited to 'core/src/main/kotlin/model/documentableUtils.kt')
-rw-r--r--core/src/main/kotlin/model/documentableUtils.kt15
1 files changed, 6 insertions, 9 deletions
diff --git a/core/src/main/kotlin/model/documentableUtils.kt b/core/src/main/kotlin/model/documentableUtils.kt
index 7f946344..b09260ee 100644
--- a/core/src/main/kotlin/model/documentableUtils.kt
+++ b/core/src/main/kotlin/model/documentableUtils.kt
@@ -1,21 +1,18 @@
package org.jetbrains.dokka.model
-import org.jetbrains.dokka.pages.PlatformData
+fun <T> SourceSetDependent<T>.filtered(platformDataList: List<SourceSetData>) = filter { it.key in platformDataList }
+fun SourceSetData?.filtered(platformDataList: List<SourceSetData>) = takeIf { this in platformDataList }
-fun <T> PlatformDependent<T>.filtered(platformDataList: List<PlatformData>) = PlatformDependent(
- map.filter { it.key in platformDataList },
- expect
-)
-
-fun DTypeParameter.filter(filteredData: List<PlatformData>) =
- if (filteredData.containsAll(platformData)) this
+fun DTypeParameter.filter(filteredData: List<SourceSetData>) =
+ if (filteredData.containsAll(sourceSets)) this
else {
- val intersection = filteredData.intersect(platformData).toList()
+ val intersection = filteredData.intersect(sourceSets).toList()
if (intersection.isEmpty()) null
else DTypeParameter(
dri,
name,
documentation.filtered(intersection),
+ expectPresentInSet?.takeIf { intersection.contains(expectPresentInSet) },
bounds,
intersection,
extra