diff --git a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/FileElementInfo.java b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/FileElementInfo.java index a9f5bb8d6e07..ee74a28b3b8b 100644 --- a/platform/core-impl/src/com/intellij/psi/impl/smartPointers/FileElementInfo.java +++ b/platform/core-impl/src/com/intellij/psi/impl/smartPointers/FileElementInfo.java @@ -76,6 +76,10 @@ class FileElementInfo implements SmartPointerElementInfo { if (other instanceof FileElementInfo) { return Comparing.equal(myVirtualFile, ((FileElementInfo)other).myVirtualFile); } + if (other instanceof SelfElementInfo && ((SelfElementInfo)other).getSyncStartOffset() != 0) { + // SelfElementInfo need psi (parsing) for element restoration and apriori could not reference psi file + return false; + } return Comparing.equal(restoreElement(), other.restoreElement()); }