Minor: intention message changed for if/when -> assignment/return

This commit is contained in:
Mikhail Glukhikh
2016-09-12 15:01:17 +03:00
parent edacc7f8d7
commit 222b964f3a
4 changed files with 16 additions and 4 deletions
@@ -26,7 +26,10 @@ import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.psi.createExpressionByPattern
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
class FoldIfToAssignmentIntention : SelfTargetingRangeIntention<KtIfExpression>(KtIfExpression::class.java, "Replace 'if' expression with assignment") {
class FoldIfToAssignmentIntention : SelfTargetingRangeIntention<KtIfExpression>(
KtIfExpression::class.java,
"Lift assignment out of 'if' expression"
) {
override fun applicabilityRange(element: KtIfExpression): TextRange? {
val branches = element.branches
@@ -26,7 +26,10 @@ import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.psi.createExpressionByPattern
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
class FoldIfToReturnIntention : SelfTargetingRangeIntention<KtIfExpression>(KtIfExpression::class.java, "Replace 'if' expression with return") {
class FoldIfToReturnIntention : SelfTargetingRangeIntention<KtIfExpression>(
KtIfExpression::class.java,
"Lift return out of 'if' expression"
) {
override fun applicabilityRange(element: KtIfExpression): TextRange? {
val branches = element.branches
@@ -23,7 +23,10 @@ import org.jetbrains.kotlin.idea.intentions.branchedTransformations.BranchedFold
import org.jetbrains.kotlin.psi.*
import java.util.*
class FoldWhenToAssignmentIntention : SelfTargetingRangeIntention<KtWhenExpression>(KtWhenExpression::class.java, "Replace 'when' expression with assignment") {
class FoldWhenToAssignmentIntention : SelfTargetingRangeIntention<KtWhenExpression>(
KtWhenExpression::class.java,
"Lift assignment out of 'when' expression"
) {
override fun applicabilityRange(element: KtWhenExpression): TextRange? {
if (!KtPsiUtil.checkWhenExpressionHasSingleElse(element)) return null
@@ -22,7 +22,10 @@ import org.jetbrains.kotlin.idea.intentions.SelfTargetingRangeIntention
import org.jetbrains.kotlin.idea.intentions.branchedTransformations.BranchedFoldingUtils
import org.jetbrains.kotlin.psi.*
class FoldWhenToReturnIntention : SelfTargetingRangeIntention<KtWhenExpression>(KtWhenExpression::class.java, "Replace 'when' expression with return") {
class FoldWhenToReturnIntention : SelfTargetingRangeIntention<KtWhenExpression>(
KtWhenExpression::class.java,
"Lift return out of 'when' expression"
) {
override fun applicabilityRange(element: KtWhenExpression): TextRange? {
if (!KtPsiUtil.checkWhenExpressionHasSingleElse(element)) return null