boolean (@NotNull PsiFile file, @NotNull Predicate<? super PsiFile> predicate) { if (ApplicationManager.getApplication().isUnitTestMode()) return true; // always run in tests VirtualFile vFile = file.getVirtualFile(); if (vFile == null) return false; if (TestSourcesFilter.isTestSources(vFile, file.getProject())) return false; if (PsiUtil.isIdeaProject(file.getProject())) { return predicate.test(file); } return isInPluginModule(file); }