VirtualFile () { E psiElement = getPsiElement(); if (psiElement.isValid()) { if (psiElement instanceof PsiFileSystemItem) { return ((PsiFileSystemItem)psiElement).getVirtualFile(); } PsiFile psiFile = psiElement.getContainingFile(); if (psiFile != null) { VirtualFile virtualFile = psiFile.getVirtualFile(); if (virtualFile != null && virtualFile.isValid()) { return virtualFile; } } } return null; }