Fix if -> ?: / ?. highlight type

if should be transformed, default level used (weak warning);
if should not be transformed, no highlighting (information) used.
This commit is contained in:
Mikhail Glukhikh
2017-06-16 15:23:48 +03:00
parent 9e85b0c2ba
commit ace3bfbbf9
2 changed files with 2 additions and 2 deletions
@@ -38,7 +38,7 @@ class IfThenToElvisInspection : IntentionBasedInspection<KtIfExpression>(
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<KtIfExpression>(
@@ -30,7 +30,7 @@ class IfThenToSafeAccessInspection : IntentionBasedInspection<KtIfExpression>(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<KtIfExpression>(