DecompiledTextFactory: use separate descriptor renderer to render keys
Previously the same render that renders decompiled text was used by accident
This commit is contained in:
+4
-3
@@ -74,7 +74,7 @@ private val DECOMPILED_CODE_COMMENT = "/* compiled code */"
|
|||||||
private val DECOMPILED_COMMENT_FOR_PARAMETER = "/* = compiled code */"
|
private val DECOMPILED_COMMENT_FOR_PARAMETER = "/* = compiled code */"
|
||||||
private val FLEXIBLE_TYPE_COMMENT = "/* platform type */"
|
private val FLEXIBLE_TYPE_COMMENT = "/* platform type */"
|
||||||
|
|
||||||
public val descriptorRendererForDecompiler: DescriptorRenderer = DescriptorRendererBuilder()
|
private val descriptorRendererForDecompiler = DescriptorRendererBuilder()
|
||||||
.setWithDefinedIn(false)
|
.setWithDefinedIn(false)
|
||||||
.setClassWithPrimaryConstructor(true)
|
.setClassWithPrimaryConstructor(true)
|
||||||
.setTypeNormalizer {
|
.setTypeNormalizer {
|
||||||
@@ -87,9 +87,10 @@ public val descriptorRendererForDecompiler: DescriptorRenderer = DescriptorRende
|
|||||||
}
|
}
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
//TODO: should use more accurate way to identify descriptors
|
private val descriptorRendererForKeys = DescriptorRenderer.COMPACT_WITH_MODIFIERS
|
||||||
|
|
||||||
public fun descriptorToKey(descriptor: DeclarationDescriptor): String {
|
public fun descriptorToKey(descriptor: DeclarationDescriptor): String {
|
||||||
return descriptorRendererForDecompiler.render(descriptor)
|
return descriptorRendererForKeys.render(descriptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
public data class DecompiledText(public val text: String, public val renderedDescriptorsToRange: Map<String, TextRange>)
|
public data class DecompiledText(public val text: String, public val renderedDescriptorsToRange: Map<String, TextRange>)
|
||||||
|
|||||||
Reference in New Issue
Block a user