mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Make "Push condition inside call" intention available on entire conditional expression
This commit is contained in:
+1
-2
@@ -39,7 +39,6 @@ public class PushConditionInCallAction extends PsiElementBaseIntentionAction {
|
||||
if (element instanceof PsiCompiledElement) return false;
|
||||
if (!element.getManager().isInProject(element)) return false;
|
||||
|
||||
if (!(element instanceof PsiJavaToken && ((PsiJavaToken)element).getTokenType() == JavaTokenType.QUEST)) return false;
|
||||
final PsiConditionalExpression conditionalExpression = PsiTreeUtil.getParentOfType(element, PsiConditionalExpression.class);
|
||||
if (conditionalExpression == null) return false;
|
||||
final PsiExpression thenExpression = conditionalExpression.getThenExpression();
|
||||
@@ -75,7 +74,7 @@ public class PushConditionInCallAction extends PsiElementBaseIntentionAction {
|
||||
}
|
||||
}
|
||||
}
|
||||
setText("Push condition " + conditionalExpression.getCondition().getText() + " inside " +
|
||||
setText("Push condition '" + conditionalExpression.getCondition().getText() + "' inside " +
|
||||
(thenMethod.isConstructor() ? "constructor" : "method") + " call");
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user