Condition<PsiFileSystemItem> () { return item -> { Project project = item.getProject(); PsiFile originalFile = getElement().getContainingFile().getOriginalFile(); VirtualFile ignoreFile = originalFile.getVirtualFile(); Language language = originalFile.getLanguage(); if (!(language instanceof IgnoreLanguage)) return false; VirtualFile ignoreFileAffectedRoot = ((IgnoreLanguage)language).getAffectedRoot(project, ignoreFile); VirtualFile ignoreFileVcsRoot = VcsUtil.getVcsRootFor(project, ignoreFileAffectedRoot); if (ignoreFileVcsRoot == null) return false; return isFileUnderSameVcsRoot(project, ignoreFileVcsRoot, item.getVirtualFile()); }; }