Added inspection based on ReplaceWithOperatorAssignIntention
This commit is contained in:
@@ -906,10 +906,17 @@
|
||||
/>
|
||||
|
||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.intentions.SimplifyBinaryNegationInspection"
|
||||
displayName="Simplify Negated Binary Expression"
|
||||
displayName="Simplify negated binary expression"
|
||||
groupName="Kotlin"
|
||||
enabledByDefault="true"
|
||||
level="WARNING"
|
||||
level="WEAK WARNING"
|
||||
/>
|
||||
|
||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.intentions.ReplaceWithOperatorAssignInspection"
|
||||
displayName="Replace with operator-assignment"
|
||||
groupName="Kotlin"
|
||||
enabledByDefault="true"
|
||||
level="WEAK WARNING"
|
||||
/>
|
||||
|
||||
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection"
|
||||
|
||||
@@ -27,7 +27,7 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.idea.util.psi.patternMatching.matches
|
||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||
|
||||
public class ReplaceWithOperatorAssignIntention : JetSelfTargetingOffsetIndependentIntention<JetBinaryExpression>(javaClass(), "Replace with an operator-assignment") {
|
||||
public class ReplaceWithOperatorAssignIntention : JetSelfTargetingOffsetIndependentIntention<JetBinaryExpression>(javaClass(), "Replace with operator-assignment") {
|
||||
|
||||
override fun isApplicableTo(element: JetBinaryExpression): Boolean {
|
||||
if (element.getOperationToken() != JetTokens.EQ) return false
|
||||
|
||||
@@ -21,10 +21,7 @@ import org.jetbrains.kotlin.idea.inspections.IntentionBasedInspection
|
||||
import org.jetbrains.kotlin.idea.intentions.attributeCallReplacements.ReplaceGetIntention
|
||||
import org.jetbrains.kotlin.idea.intentions.branchedTransformations.intentions.IfThenToElvisIntention
|
||||
import org.jetbrains.kotlin.idea.intentions.branchedTransformations.intentions.IfThenToSafeAccessIntention
|
||||
import org.jetbrains.kotlin.psi.JetDotQualifiedExpression
|
||||
import org.jetbrains.kotlin.psi.JetIfExpression
|
||||
import org.jetbrains.kotlin.psi.JetPrefixExpression
|
||||
import org.jetbrains.kotlin.psi.JetTypeArgumentList
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
|
||||
public class ExplicitGetInspection : IntentionBasedInspection<JetDotQualifiedExpression>(ReplaceGetIntention())
|
||||
|
||||
@@ -41,3 +38,5 @@ public class RemoveExplicitTypeArgsInspection : IntentionBasedInspection<JetType
|
||||
|
||||
public class SimplifyBinaryNegationInspection : IntentionBasedInspection<JetPrefixExpression>(SimplifyNegatedBinaryExpressionIntention())
|
||||
|
||||
public class ReplaceWithOperatorAssignInspection : IntentionBasedInspection<JetBinaryExpression>(ReplaceWithOperatorAssignIntention())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user