From d8181953c3e8abb19bc6e7d3235c058b95b4e76a Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 10 Apr 2018 15:33:06 +0200 Subject: [PATCH] [rider] allow to pass postRunnable argument for test purpose --- .../codeInspection/actions/SilentCodeCleanupAction.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInspection/actions/SilentCodeCleanupAction.java b/platform/lang-impl/src/com/intellij/codeInspection/actions/SilentCodeCleanupAction.java index 1454dc3acff8..af10ffee881a 100644 --- a/platform/lang-impl/src/com/intellij/codeInspection/actions/SilentCodeCleanupAction.java +++ b/platform/lang-impl/src/com/intellij/codeInspection/actions/SilentCodeCleanupAction.java @@ -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")