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:
+1
-1
@@ -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>(
|
||||
|
||||
+1
-1
@@ -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>(
|
||||
|
||||
Reference in New Issue
Block a user