Reduce range of IfThenTo... inspections to just 'if'
This commit is contained in:
+3
-1
@@ -33,7 +33,9 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
|
||||
class IfThenToElvisInspection : IntentionBasedInspection<KtIfExpression>(
|
||||
IfThenToElvisIntention::class,
|
||||
{ it -> it.isUsedAsExpression(it.analyze(BodyResolveMode.PARTIAL)) }
|
||||
)
|
||||
) {
|
||||
override fun inspectionTarget(element: KtIfExpression) = element.ifKeyword
|
||||
}
|
||||
|
||||
class IfThenToElvisIntention : SelfTargetingOffsetIndependentIntention<KtIfExpression>(
|
||||
KtIfExpression::class.java,
|
||||
|
||||
+4
-1
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.kotlin.idea.intentions.branchedTransformations.intentions
|
||||
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.idea.core.replaced
|
||||
import org.jetbrains.kotlin.idea.inspections.IntentionBasedInspection
|
||||
import org.jetbrains.kotlin.idea.intentions.SelfTargetingOffsetIndependentIntention
|
||||
@@ -24,7 +25,9 @@ import org.jetbrains.kotlin.idea.intentions.branchedTransformations.*
|
||||
import org.jetbrains.kotlin.idea.util.application.runWriteAction
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
|
||||
class IfThenToSafeAccessInspection : IntentionBasedInspection<KtIfExpression>(IfThenToSafeAccessIntention::class)
|
||||
class IfThenToSafeAccessInspection : IntentionBasedInspection<KtIfExpression>(IfThenToSafeAccessIntention::class) {
|
||||
override fun inspectionTarget(element: KtIfExpression) = element.ifKeyword
|
||||
}
|
||||
|
||||
class IfThenToSafeAccessIntention : SelfTargetingOffsetIndependentIntention<KtIfExpression>(
|
||||
KtIfExpression::class.java, "Replace 'if' expression with safe access expression"
|
||||
|
||||
Reference in New Issue
Block a user