mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
restore intention place; fix tests
This commit is contained in:
@@ -39,6 +39,7 @@ 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();
|
||||
@@ -74,7 +75,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;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Push condition b inside method call" "true"
|
||||
// "Push condition 'b' inside method call" "true"
|
||||
class Foo {
|
||||
void bar(boolean b){
|
||||
String s = foo(b ? "true" : "false");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Push condition b inside method call" "true"
|
||||
// "Push condition 'b' inside method call" "true"
|
||||
class Foo {
|
||||
void bar(boolean b){
|
||||
String s = b <caret>? foo("true") : foo("false");
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Push condition b inside method call" "false"
|
||||
// "Push condition 'b' inside method call" "false"
|
||||
class Foo {
|
||||
void bar(boolean b){
|
||||
String s = b <caret>? foo("true") : foo(false);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Push condition b inside method call" "false"
|
||||
// "Push condition 'b' inside method call" "false"
|
||||
class Foo {
|
||||
void bar(boolean b){
|
||||
String s = b <caret>? foo("true", true) : foo("false", false);
|
||||
|
||||
Reference in New Issue
Block a user