boolean (@NotNull Project project, @NotNull VirtualFile virtualFile) { ProjectFileIndex index = ProjectRootManager.getInstance(project).getFileIndex(); return !index.isUnderSourceRootOfType(virtualFile, JavaModuleSourceRootTypes.SOURCES); }