public static List<PsiFile> allFilesIn(Path dir, String extension, Project project) {
        if (extension.startsWith("."))
            extension = extension.substring(1);
        return FilenameIndex.getAllFilesByExt(project, extension)
                            .stream()
                            .filter(file -> file.getParent().getPath().endsWith(dir.getRelative()))
                            .map(file -> PsiManager.getInstance(project).findFile(file))
                            .toList();
    }
Returns all the files in the given directory with the given ending.
integration/intellij/src/main/java/ai/vespa/intellij/schema/utils/Files.java