From ecadf405143811776f46142e7c97cc33380efb68 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 20 Feb 2015 14:44:30 +0100 Subject: allow a LocationService to take a qualified name directly, not just a DocumentationNode --- src/Locations/LocationService.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/Locations/LocationService.kt') 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, 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, hasMembers: Boolean): FileLocation } -- cgit