aboutsummaryrefslogtreecommitdiff
path: root/src/Locations/LocationService.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-20 14:44:30 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-20 14:44:30 +0100
commitecadf405143811776f46142e7c97cc33380efb68 (patch)
treec03992fcd662e333cdc360a44a6e5d3b9ebb6120 /src/Locations/LocationService.kt
parent85a3ae7626810113816fd31a0e26d44d48308ed2 (diff)
downloaddokka-ecadf405143811776f46142e7c97cc33380efb68.tar.gz
dokka-ecadf405143811776f46142e7c97cc33380efb68.tar.bz2
dokka-ecadf405143811776f46142e7c97cc33380efb68.zip
allow a LocationService to take a qualified name directly, not just a DocumentationNode
Diffstat (limited to 'src/Locations/LocationService.kt')
-rw-r--r--src/Locations/LocationService.kt10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Locations/LocationService.kt b/src/Locations/LocationService.kt
index 500b89f2..cb05535a 100644
--- a/src/Locations/LocationService.kt
+++ b/src/Locations/LocationService.kt
@@ -41,15 +41,19 @@ public data class FileLocation(val file: File): Location {
public trait LocationService {
fun withExtension(newExtension: String) = this
+ fun location(node: DocumentationNode): Location = location(node.path.map { it.name }, node.members.any())
+
/**
- * Calculates location for particular node in output structure
+ * Calculates a location corresponding to the specified [qualifiedName].
+ * @param hasMembers if true, the node for which the location is calculated has member nodes.
*/
- fun location(node: DocumentationNode): Location
+ fun location(qualifiedName: List<String>, hasMembers: Boolean): Location
}
public trait FileLocationService: LocationService {
- override fun location(node: DocumentationNode): FileLocation
+ override fun location(node: DocumentationNode): FileLocation = location(node.path.map { it.name }, node.members.any())
+ override fun location(qualifiedName: List<String>, hasMembers: Boolean): FileLocation
}