From a3ec2e2afd6f4140ac78f7630fa9c2ca1f8ca8af Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 12 Jan 2016 16:14:21 +0100 Subject: generate signature-based anchors for overloads; use signature instead of name as an anchor for in-page links --- core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/src/main/kotlin/Java') diff --git a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt index 67bf1f08..9d75792c 100644 --- a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt +++ b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt @@ -6,15 +6,15 @@ import com.intellij.psi.util.InheritanceUtil fun getSignature(element: PsiElement?) = when(element) { is PsiClass -> element.qualifiedName - is PsiField -> element.containingClass!!.qualifiedName + "#" + element.name + is PsiField -> element.containingClass!!.qualifiedName + "$" + element.name is PsiMethod -> - element.containingClass!!.qualifiedName + "#" + element.name + "(" + + element.containingClass!!.qualifiedName + "$" + element.name + "(" + element.parameterList.parameters.map { it.type.typeSignature() }.joinToString(",") + ")" else -> null } private fun PsiType.typeSignature(): String = when(this) { - is PsiArrayType -> "Array<${componentType.typeSignature()}>" + is PsiArrayType -> "Array((${componentType.typeSignature()}))" else -> mapTypeName(this) } -- cgit