PsiFile (@NotNull Document document) { VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(document); return virtualFile == null || !virtualFile.isValid() ? null : getCachedPsiFile(virtualFile); }