Collection<VirtualFile> (@NotNull final String extension, @NotNull Project project) { final Collection<VirtualFile> files = new HashSet<>(100); FileIndex index = ProjectRootManager.getInstance(project).getFileIndex(); index.iterateContent(fileOrDir -> { if (StringUtil.equals(fileOrDir.getExtension(), extension)) { files.add(fileOrDir); } return true; }); return files; }