aboutsummaryrefslogtreecommitdiff
path: root/src/Locations/LocationService.kt
diff options
context:
space:
mode:
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
}