diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-26 15:48:01 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-26 15:48:01 +0100 |
commit | 6714d6574a14200175d1d3db903e50ef4267aaf7 (patch) | |
tree | 1c7bf00fa688af74f0f79062bd9b35f71981b853 /src/Kotlin/DocumentationBuilder.kt | |
parent | 6459ec0493241336c9db8dc6d53abce17f3126cd (diff) | |
download | dokka-6714d6574a14200175d1d3db903e50ef4267aaf7.tar.gz dokka-6714d6574a14200175d1d3db903e50ef4267aaf7.tar.bz2 dokka-6714d6574a14200175d1d3db903e50ef4267aaf7.zip |
include receiver type and parameter types in the signature of a property
Diffstat (limited to 'src/Kotlin/DocumentationBuilder.kt')
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index 1d7589a5..6ce7727c 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -74,7 +74,7 @@ class DocumentationBuilder(val session: ResolveSession, fun DeclarationDescriptor.signature(): String = when(this) { is ClassDescriptor, is PackageFragmentDescriptor -> DescriptorUtils.getFqName(this).asString() - is PropertyDescriptor -> getContainingDeclaration().signature() + "#" + getName() + is PropertyDescriptor -> getContainingDeclaration().signature() + "#" + getName() + receiverSignature() is FunctionDescriptor -> getContainingDeclaration().signature() + "#" + getName() + parameterSignature() is ValueParameterDescriptor -> getContainingDeclaration().signature() + ":" + getName() is TypeParameterDescriptor -> getContainingDeclaration().signature() + "<" + getName() @@ -82,7 +82,14 @@ class DocumentationBuilder(val session: ResolveSession, else -> throw UnsupportedOperationException("Don't know how to calculate signature for $this") } - fun FunctionDescriptor.parameterSignature(): String { + fun PropertyDescriptor.receiverSignature(): String { + if (getExtensionReceiverParameter() != null || getValueParameters().size() > 0) { + return "#" + parameterSignature() + } + return "" + } + + fun CallableMemberDescriptor.parameterSignature(): String { val params = getValueParameters().map { it.getType() }.toArrayList() val extensionReceiver = getExtensionReceiverParameter() if (extensionReceiver != null) { |