IDEA-163195 - ignore creation the fix if it's a batch mode

GitOrigin-RevId: 8574fa25c43de38058cd18848d0d77314b5fbfc5
This commit is contained in:
Ilyas Selimov
2020-06-19 08:44:41 +03:00
committed by intellij-monorepo-bot
parent 7ef1e04f92
commit 3c105474e5
@@ -42,6 +42,11 @@ public class AssertWithoutMessageInspection extends BaseInspection {
return InspectionGadgetsBundle.message("assert.without.message.problem.descriptor");
}
@Override
protected boolean buildQuickFixesOnlyForOnTheFlyErrors() {
return true;
}
private static class AssertionsWithoutMessagesVisitor extends BaseInspectionVisitor {
@Override
@@ -82,11 +87,9 @@ public class AssertWithoutMessageInspection extends BaseInspection {
createdMessageExpr = methodArgs.add(newMessageExpr);
}
if (isOnTheFly()) {
Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
if (editor == null) return;
editor.getCaretModel().moveToOffset(createdMessageExpr.getTextOffset() + 1);
}
Editor editor = FileEditorManager.getInstance(project).getSelectedTextEditor();
if (editor == null) return;
editor.getCaretModel().moveToOffset(createdMessageExpr.getTextOffset() + 1);
}
@Override