boolean (@NotNull VirtualFile f, boolean shouldBeInContent) { if (VersionManagingFileSystem.isDisabled(f)) { return false; } if (!f.isInLocalFileSystem()) { return VersionManagingFileSystem.isEnforcedNonLocal(f); } if (!f.isDirectory()) { CharSequence fileName = f.getNameSequence(); if (StringUtil.equals(fileName, "workspace.xml") || StringUtil.endsWith(fileName, ".iws") || StringUtil.endsWith(fileName, ".class")) { return false; } } VersionedFilterData versionedFilterData = getVersionedFilterData(); int numberOfOpenProjects = versionedFilterData.myOpenedProjects.size(); // optimisation: FileTypeManager.isFileIgnored(f) will be checked inside ProjectFileIndex.isUnderIgnored() if (numberOfOpenProjects == 0) { if (shouldBeInContent) return false; // there is no project, so the file can't be in content if (FileTypeManager.getInstance().isFileIgnored(f)) return false; return true; } boolean isExcludedFromAll = true; boolean isInContent = false; for (int i = 0; i < numberOfOpenProjects; ++i) { ProjectFileIndex index = versionedFilterData.myProjectFileIndices.get(i); if (index.isUnderIgnored(f)) return false; isInContent |= index.isInContent(f); isExcludedFromAll &= index.isExcluded(f); } if (isExcludedFromAll) return false; if (shouldBeInContent && !isInContent) return false; return true; }