Merge pull request #433 from kuity/ReplaceInfixCallFix
Bug Fix for KT-4652 Replace with Infix Call
This commit is contained in:
@@ -34,6 +34,20 @@ import org.jetbrains.jet.lang.psi.JetFile
|
||||
|
||||
public class ReplaceWithInfixFunctionCallIntention : JetSelfTargetingIntention<JetCallExpression>("replace.with.infix.function.call.intention", javaClass()) {
|
||||
override fun isApplicableTo(element: JetCallExpression): Boolean {
|
||||
throw IllegalStateException("isApplicableTo(JetExpressionImpl, Editor) should be called instead")
|
||||
}
|
||||
|
||||
override fun isApplicableTo(element: JetCallExpression, editor: Editor): Boolean {
|
||||
val caretLocation = editor.getCaretModel().getOffset()
|
||||
|
||||
val calleeExpr = element.getCalleeExpression()
|
||||
if (calleeExpr == null) return false
|
||||
|
||||
val textRange = calleeExpr.getTextRange()
|
||||
if (textRange == null) return false
|
||||
|
||||
if (caretLocation !in textRange) return false
|
||||
|
||||
val parent = element.getParent()
|
||||
|
||||
if (parent is JetDotQualifiedExpression) {
|
||||
|
||||
Reference in New Issue
Block a user