PsiFile () { PsiFile psiFile = com.intellij.reference.SoftReference.dereference(myPsiFile); if (psiFile != null && psiFile.isValid()) { return psiFile; } VirtualFile virtualFile = getVirtualFile(); if (virtualFile == null || !virtualFile.isValid()) return null; psiFile = PsiManager.getInstance(myProject).findFile(virtualFile); myPsiFile = new SoftReference<>(psiFile); return psiFile; }