disable fixes in batch mode (IDEA-CR-21292)

This commit is contained in:
Anna Kozlova
2017-05-24 10:11:50 +03:00
parent a5e1d1faa3
commit 86c6da36f7
3 changed files with 11 additions and 2 deletions
@@ -17,7 +17,6 @@ package com.intellij.refactoring.invertBoolean;
import com.intellij.openapi.actionSystem.CommonDataKeys;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.application.TransactionGuard;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Editor;
import com.intellij.openapi.editor.ScrollType;
@@ -73,7 +72,7 @@ public class InvertBooleanHandler implements RefactoringActionHandler {
}
PsiElement element = delegate.adjustElement(elements[0], project, null);
if (element != null && PsiElementRenameHandler.canRename(project, null, element)) {
TransactionGuard.getInstance().submitTransactionAndWait(() -> new InvertBooleanDialog(element).show());
new InvertBooleanDialog(element).show();
}
}
}
@@ -49,6 +49,11 @@ class BooleanVariableAlwaysNegatedInspectionBase extends BaseInspection {
}
}
@Override
protected boolean buildQuickFixesOnlyForOnTheFlyErrors() {
return true;
}
@Override
public BaseInspectionVisitor buildVisitor() {
return new BooleanVariableAlwaysNegatedVisitor();
@@ -47,6 +47,11 @@ public class NegativelyNamedBooleanVariableInspectionBase extends BaseInspection
return InspectionGadgetsBundle.message("negatively.named.boolean.variable.problem.descriptor");
}
@Override
protected boolean buildQuickFixesOnlyForOnTheFlyErrors() {
return true;
}
@Override
public BaseInspectionVisitor buildVisitor() {
return new NegativelyNamedBooleanVariableVisitor();