LocalInspectionsPass (@NotNull PsiFile file, @NotNull TextRange visibleRange, @NotNull Document document) { return new LocalInspectionsPass(file, document, file.getTextRange(), visibleRange, true, new DefaultHighlightInfoProcessor(), false) { @Override protected boolean isAcceptableLocalTool(@NotNull LocalInspectionToolWrapper wrapper) { return wrapper.runForWholeFile(); } @NotNull @Override List<LocalInspectionToolWrapper> getInspectionTools(@NotNull InspectionProfileWrapper profile) { List<LocalInspectionToolWrapper> result = super.getInspectionTools(profile); if (result.isEmpty()) { WholeFileLocalInspectionPassTracker tracker = WholeFileLocalInspectionPassTracker.getInstance(file.getProject()); tracker.lookThereAreNoWholeFileToolsConfiguredForThisFileSoWeCanProbablySkipItAltogether(file); } return result; } @Override protected String getPresentableName() { return DaemonBundle.message("pass.whole.inspections"); } @Override protected void collectInformationWithProgress(@NotNull ProgressIndicator progress) { super.collectInformationWithProgress(progress); WholeFileLocalInspectionPassTracker.getInstance(file.getProject()).informationApplied(file); } }; }