List<VirtualFile> (@NotNull AnActionEvent e, @NotNull Project project) { final VirtualFile[] files = e.getData(CommonDataKeys.VIRTUAL_FILE_ARRAY); if (files == null) return Collections.emptyList(); List<VirtualFile> result = new ArrayList<>(); ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex(); final CompilerManager compilerManager = CompilerManager.getInstance(project); for (VirtualFile file : files) { if (file == null || file.isDirectory() || fileIndex.isUnderSourceRootOfType(file, JavaModuleSourceRootTypes.SOURCES) && compilerManager.isCompilableFileType(file.getFileType())) { return Collections.emptyList(); } final Collection<? extends Artifact> artifacts = ArtifactBySourceFileFinder.getInstance(project).findArtifacts(file); for (Artifact artifact : artifacts) { if (!StringUtil.isEmpty(artifact.getOutputPath())) { result.add(file); break; } } } return result; }