void (@Nullable PsiElement root) { if (root != null && myOriginalPsiFile != null) { PsiFile newPsiFile = root.getContainingFile(); newPsiFile.putUserData(PsiFileFactory.ORIGINAL_FILE, myOriginalPsiFile); VirtualFile newVirtualFile = newPsiFile.getVirtualFile(); if (newVirtualFile instanceof LightVirtualFile) { ((LightVirtualFile)newVirtualFile).setOriginalFile(myOriginalPsiFile.getVirtualFile()); } } }