aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-26 16:09:04 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-31 15:10:04 +0200
commit3935b4e05c13528e5b8f4b99aea1962ab904a8ee (patch)
tree219b470d72d6735859275d40543d6499436379bb /plugins/base/src/main
parent855718815ff58660a965b29247137355e67160c9 (diff)
downloaddokka-3935b4e05c13528e5b8f4b99aea1962ab904a8ee.tar.gz
dokka-3935b4e05c13528e5b8f4b99aea1962ab904a8ee.tar.bz2
dokka-3935b4e05c13528e5b8f4b99aea1962ab904a8ee.zip
Implement `root package is matched by empty string and the root keyword` test
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r--plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt
index 4900e9a8..e712d6e5 100644
--- a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt
+++ b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationReader.kt
@@ -56,6 +56,13 @@ private class ContextModuleAndPackageDocumentationReader(
}
}
+ private val ModuleAndPackageDocumentationFragment.canonicalPackageName: String
+ get() {
+ check(classifier == Classifier.Package)
+ if (name == "[root]") return ""
+ return name
+ }
+
override fun get(module: DModule): SourceSetDependent<DocumentationNode> {
return findDocumentationNodes(module.sourceSets) { fragment ->
fragment.classifier == Classifier.Module && (
@@ -68,8 +75,7 @@ private class ContextModuleAndPackageDocumentationReader(
override fun get(pkg: DPackage): SourceSetDependent<DocumentationNode> {
return findDocumentationNodes(pkg.sourceSets) { fragment ->
- // TODO NOW: handle JS Root thing
- fragment.classifier == Classifier.Package && fragment.name == pkg.dri.packageName
+ fragment.classifier == Classifier.Package && fragment.canonicalPackageName == pkg.dri.packageName
}
}
}