PsiFile (Module module, @Nullable String filename) { if (filename == null) return null; String nameWithSuffix = filename + ".html"; return DescriptionCheckerUtil.allDescriptionDirs(module, DescriptionType.INSPECTION) .map(directory -> directory.findFile(nameWithSuffix)).nonNull().findFirst().orElse(null); }