boolean (SelectInContext context) { ProjectFileIndex fileIndex = ProjectRootManager.getInstance(context.getProject()).getFileIndex(); VirtualFile file = context.getVirtualFile(); if (file instanceof FacetAsVirtualFile) { return ((FacetAsVirtualFile)file).findFacet() != null; } return fileIndex.isInContent(file) || fileIndex.isInLibrary(file) || FileTypeRegistry.getInstance().isFileOfType(file, ModuleFileType.INSTANCE) && findModuleByModuleFile(context.getProject(), file) != null; }