aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/resolvers/local
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-08-14 14:59:04 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-08-19 13:34:10 +0200
commitc4e4343bdb8df16e49d4da118fccc076abdc928a (patch)
tree19113d8630d6a24507184876e9d064ec833bc965 /plugins/base/src/main/kotlin/resolvers/local
parent28d6598bc749612f75a5c1a4210eb4b0f5aa1f6e (diff)
downloaddokka-c4e4343bdb8df16e49d4da118fccc076abdc928a.tar.gz
dokka-c4e4343bdb8df16e49d4da118fccc076abdc928a.tar.bz2
dokka-c4e4343bdb8df16e49d4da118fccc076abdc928a.zip
Respect relocated declarations
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers/local')
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt8
-rw-r--r--plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt6
2 files changed, 6 insertions, 8 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
index 45b39eec..c25aa543 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/DefaultLocationProvider.kt
@@ -1,13 +1,12 @@
package org.jetbrains.dokka.base.resolvers.local
-import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.resolvers.external.ExternalLocationProvider
import org.jetbrains.dokka.base.resolvers.shared.ExternalDocumentation
import org.jetbrains.dokka.base.resolvers.shared.PackageList
import org.jetbrains.dokka.links.DRI
-import org.jetbrains.dokka.pages.RootPageNode
import org.jetbrains.dokka.model.DisplaySourceSet
+import org.jetbrains.dokka.pages.RootPageNode
import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.plugability.plugin
import org.jetbrains.dokka.plugability.query
@@ -25,7 +24,7 @@ abstract class DefaultLocationProvider(
.sourceSets
.flatMap { sourceSet ->
sourceSet.externalDocumentationLinks.map {
- PackageList.load(it.packageListUrl, sourceSet.jdkVersion, dokkaContext)
+ PackageList.load(it.packageListUrl, sourceSet.jdkVersion, dokkaContext.configuration.offlineMode)
?.let { packageList -> ExternalDocumentation(it.url, packageList) }
}
}
@@ -35,14 +34,13 @@ abstract class DefaultLocationProvider(
val externalLocationProvider = (externalLocationProviderFactories.asSequence()
.mapNotNull { it.getExternalLocationProvider(extDocInfo) }.firstOrNull()
?: run { dokkaContext.logger.error("No ExternalLocationProvider for '${extDocInfo.packageList.url}' found"); null })
- run { null }
packageName to externalLocationProvider
}
}
.toMap()
.filterKeys(String::isNotBlank)
- protected open fun getExternalLocation(dri: DRI, sourceSets: Set<DokkaSourceSet>): String? =
+ protected open fun getExternalLocation(dri: DRI, sourceSets: Set<DisplaySourceSet>): String? =
packagesIndex[dri.packageName]?.resolve(dri)
}
diff --git a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt
index d2e6d49b..ca2332db 100644
--- a/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/local/DokkaLocationProvider.kt
@@ -1,8 +1,8 @@
package org.jetbrains.dokka.base.resolvers.local
-import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.base.resolvers.anchors.SymbolAnchorHint
import org.jetbrains.dokka.links.DRI
+import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.model.withDescendants
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.plugability.DokkaContext
@@ -44,7 +44,7 @@ open class DokkaLocationProvider(
override fun resolve(node: PageNode, context: PageNode?, skipExtension: Boolean) =
pathTo(node, context) + if (!skipExtension) extension else ""
- override fun resolve(dri: DRI, sourceSets: Set<DokkaSourceSet>, context: PageNode?) =
+ override fun resolve(dri: DRI, sourceSets: Set<DisplaySourceSet>, context: PageNode?) =
pagesIndex[dri]?.let { resolve(it, context) }
?: anchorsIndex[dri]?.let { resolve(it, context) + "#$dri" }
// Not found in PageGraph, that means it's an external link
@@ -58,7 +58,7 @@ open class DokkaLocationProvider(
protected open fun pathTo(node: PageNode, context: PageNode?): String {
fun pathFor(page: PageNode) = pathsIndex[page] ?: throw AssertionError(
- "${page::class.simpleName}(${page.name}) does not belong to current page graph so it is impossible to compute its path"
+ "${page::class.simpleName}(${page.name}) does not belong to the current page graph so it is impossible to compute its path"
)
val contextNode =