From b643bf6f4b4c29676ce3301d92b7880b268d6722 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Thu, 5 Nov 2015 15:51:23 +0100 Subject: add tests; fixes related to qualified names of types --- src/Kotlin/KotlinLanguageService.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Kotlin/KotlinLanguageService.kt') diff --git a/src/Kotlin/KotlinLanguageService.kt b/src/Kotlin/KotlinLanguageService.kt index d07f4c09..0d39f410 100644 --- a/src/Kotlin/KotlinLanguageService.kt +++ b/src/Kotlin/KotlinLanguageService.kt @@ -65,8 +65,7 @@ class KotlinLanguageService : LanguageService { private fun DocumentationNode.getReceiverQName(): String? { if (kind != DocumentationNode.Kind.Function && kind != DocumentationNode.Kind.Property) return null val receiver = details(DocumentationNode.Kind.Receiver).singleOrNull() ?: return null - val receiverType = receiver.detail(DocumentationNode.Kind.Type) - return (receiverType.links.firstOrNull() ?: receiverType.hiddenLinks.firstOrNull())?.qualifiedName() + return receiver.detail(DocumentationNode.Kind.Type).qualifiedNameFromType() } companion object { @@ -405,4 +404,6 @@ class KotlinLanguageService : LanguageService { identifier(node.name) } } -} \ No newline at end of file +} + +fun DocumentationNode.qualifiedNameFromType() = (links.firstOrNull() ?: hiddenLinks.firstOrNull())?.qualifiedName() ?: name -- cgit