Refactor DescriptorRenderer's renderAccessors option

In some tests with txt (probably all except loadJava), property
accessors are not rendered at all, so a third option value (NONE) will
be useful to determine whether we need to render annotations on property
accessors as get/set/sparam-targeted annotations on the property
This commit is contained in:
Alexander Udalov
2018-08-13 13:31:05 +02:00
parent 896cf61443
commit 4219aff548
6 changed files with 57 additions and 25 deletions
@@ -10,6 +10,7 @@ import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers
import org.jetbrains.kotlin.load.java.JvmAbi
import org.jetbrains.kotlin.psi.KtDeclaration
import org.jetbrains.kotlin.renderer.ParameterNameRenderingPolicy
import org.jetbrains.kotlin.renderer.PropertyAccessorRenderingPolicy
import org.jetbrains.kotlin.resolve.descriptorUtil.isExtension
import javax.swing.Icon
@@ -45,7 +46,7 @@ class KotlinMethodSmartStepTarget(
private val renderer = IdeDescriptorRenderers.SOURCE_CODE_SHORT_NAMES_NO_ANNOTATIONS.withOptions {
parameterNameRenderingPolicy = ParameterNameRenderingPolicy.NONE
withoutReturnType = true
renderAccessors = true
propertyAccessorRenderingPolicy = PropertyAccessorRenderingPolicy.PRETTY
startFromName = true
modifiers = emptySet()
}
@@ -75,4 +76,4 @@ class KotlinMethodSmartStepTarget(
}
return declaration!!.hashCode()
}
}
}