mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
disable "invert if condition" on invalid negation
This commit is contained in:
@@ -47,6 +47,7 @@ public class InvertIfConditionAction extends PsiElementBaseIntentionAction {
|
||||
if (ifStatement == null) return false;
|
||||
final PsiExpression condition = ifStatement.getCondition();
|
||||
if (condition == null) return false;
|
||||
if (condition instanceof PsiPrefixExpression && ((PsiPrefixExpression)condition).getOperand() == null) return false;
|
||||
if (ifStatement.getThenBranch() == null) return false;
|
||||
if (element instanceof PsiKeyword) {
|
||||
PsiKeyword keyword = (PsiKeyword) element;
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// "Invert 'if' condition" "false"
|
||||
class A {
|
||||
public void foo(boolean c) {
|
||||
if (<caret>!) return;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user