Make JetOperationExpression an inheritor of JetExpression
This commit is contained in:
@@ -16,10 +16,9 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.psi;
|
package org.jetbrains.jet.lang.psi;
|
||||||
|
|
||||||
import com.intellij.psi.PsiElement;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
public interface JetOperationExpression extends PsiElement {
|
public interface JetOperationExpression extends JetExpression {
|
||||||
@NotNull
|
@NotNull
|
||||||
JetSimpleNameExpression getOperationReference();
|
JetSimpleNameExpression getOperationReference();
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -88,7 +88,7 @@ public class SimplifyNegatedBinaryExpressionIntention : JetSelfTargetingIntentio
|
|||||||
expression.getRight()
|
expression.getRight()
|
||||||
)
|
)
|
||||||
else -> throw IllegalStateException(
|
else -> throw IllegalStateException(
|
||||||
"Expression is neither a JetIsExpression or JetBinaryExpression (checked by isApplicableTo): ${(expression : PsiElement).getText()}"
|
"Expression is neither a JetIsExpression or JetBinaryExpression (checked by isApplicableTo): ${expression.getText()}"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
+1
-2
@@ -23,7 +23,6 @@ import org.jetbrains.jet.lang.psi.JetBlockExpression
|
|||||||
import org.jetbrains.jet.lang.psi.JetElement
|
import org.jetbrains.jet.lang.psi.JetElement
|
||||||
import org.jetbrains.jet.lang.psi.JetParameter
|
import org.jetbrains.jet.lang.psi.JetParameter
|
||||||
import org.jetbrains.jet.lang.psi.JetOperationExpression
|
import org.jetbrains.jet.lang.psi.JetOperationExpression
|
||||||
import com.intellij.psi.PsiElement
|
|
||||||
|
|
||||||
public class ConvertToForEachFunctionCallIntention : JetSelfTargetingIntention<JetForExpression>("convert.to.for.each.function.call.intention", javaClass()) {
|
public class ConvertToForEachFunctionCallIntention : JetSelfTargetingIntention<JetForExpression>("convert.to.for.each.function.call.intention", javaClass()) {
|
||||||
override fun isApplicableTo(element: JetForExpression): Boolean {
|
override fun isApplicableTo(element: JetForExpression): Boolean {
|
||||||
@@ -50,7 +49,7 @@ public class ConvertToForEachFunctionCallIntention : JetSelfTargetingIntention<J
|
|||||||
val loopRange = element.getLoopRange()!!
|
val loopRange = element.getLoopRange()!!
|
||||||
|
|
||||||
return when (loopRange) {
|
return when (loopRange) {
|
||||||
is JetOperationExpression -> "(${(loopRange : PsiElement).getText()})"
|
is JetOperationExpression -> "(${loopRange.getText()})"
|
||||||
else -> loopRange.getText() ?: throw AssertionError("LoopRange in ForExpression shouldn't be empty: expressionText = ${element.getText()}")
|
else -> loopRange.getText() ?: throw AssertionError("LoopRange in ForExpression shouldn't be empty: expressionText = ${element.getText()}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user