PsiFile (@NotNull Editor e, @NotNull VirtualFile file) { if (!file.isValid()) { return null; // fix for SCR 40329 } final Project project = e.getProject(); if (project == null) { return null; } PsiFile psiFile = PsiManager.getInstance(project).findFile(file); return psiFile != null && psiFile.isValid() ? psiFile : null; }