void (@NotNull AnalysisScope scope) { ApplicationManager.getApplication().assertWriteIntentLockAcquired(); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); LOG.info("Code inspection started"); InspectionProfileImpl profile = getCurrentProfile(); String title = profile.getSingleTool() == null ? AnalysisBundle.message("inspection.progress.profile.title", profile.getName()) : AnalysisBundle.message("inspection.progress.single.inspection.title", profile.getName()); ProgressManager.getInstance().run(new Task.Backgroundable(getProject(), title, true, createOption()) { @Override public void run(@NotNull ProgressIndicator indicator) { performInspectionsWithProgress(scope, false, false); } @Override public void onSuccess() { notifyInspectionsFinished(scope); } @Override public void onCancel() { // execute cleanup in EDT because of myTools cleanup(); } }); }