From ace3bfbbf9cd6270a9451bac164c7807e5ad5ff4 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 16 Jun 2017 15:23:48 +0300 Subject: [PATCH] Fix if -> ?: / ?. highlight type if should be transformed, default level used (weak warning); if should not be transformed, no highlighting (information) used. --- .../intentions/IfThenToElvisIntention.kt | 2 +- .../intentions/IfThenToSafeAccessIntention.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToElvisIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToElvisIntention.kt index 408aa1ee258..73ec598575b 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToElvisIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToElvisIntention.kt @@ -38,7 +38,7 @@ class IfThenToElvisInspection : IntentionBasedInspection( override fun inspectionTarget(element: KtIfExpression) = element.ifKeyword override fun problemHighlightType(element: KtIfExpression): ProblemHighlightType = - if (element.shouldBeTransformed()) ProblemHighlightType.WEAK_WARNING else super.problemHighlightType(element) + if (element.shouldBeTransformed()) super.problemHighlightType(element) else ProblemHighlightType.INFORMATION } class IfThenToElvisIntention : SelfTargetingOffsetIndependentIntention( diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToSafeAccessIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToSafeAccessIntention.kt index 4fe9fdb1592..c4724daded7 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToSafeAccessIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/branchedTransformations/intentions/IfThenToSafeAccessIntention.kt @@ -30,7 +30,7 @@ class IfThenToSafeAccessInspection : IntentionBasedInspection(If override fun inspectionTarget(element: KtIfExpression) = element.ifKeyword override fun problemHighlightType(element: KtIfExpression): ProblemHighlightType = - if (element.shouldBeTransformed()) ProblemHighlightType.WEAK_WARNING else ProblemHighlightType.INFORMATION + if (element.shouldBeTransformed()) super.problemHighlightType(element) else ProblemHighlightType.INFORMATION } class IfThenToSafeAccessIntention : SelfTargetingOffsetIndependentIntention(