[rider] allow to pass postRunnable argument for test purpose

This commit is contained in:
Dmitry Jemerov
2018-04-10 16:50:02 +02:00
parent 2038627642
commit d8181953c3
@@ -52,6 +52,10 @@ public class SilentCodeCleanupAction extends AnAction {
runInspections(project, analysisScope);
}
@SuppressWarnings("WeakerAccess")
@Nullable
protected Runnable getPostRunnable() { return null; }
@SuppressWarnings("WeakerAccess")
protected void runInspections(@NotNull Project project, @NotNull AnalysisScope scope) {
InspectionProfile profile = getProfileForSilentCleanup(project);
@@ -60,7 +64,7 @@ public class SilentCodeCleanupAction extends AnAction {
}
InspectionManager managerEx = InspectionManager.getInstance(project);
GlobalInspectionContextBase globalContext = (GlobalInspectionContextBase) managerEx.createNewGlobalContext(false);
globalContext.codeCleanup(scope, profile, getTemplatePresentation().getText(), null, false);
globalContext.codeCleanup(scope, profile, getTemplatePresentation().getText(), getPostRunnable(), false);
}
@SuppressWarnings("WeakerAccess")