PsiTreeChangeEventImpl (PsiFile file, boolean generic) { PsiTreeChangeEventImpl event = new PsiTreeChangeEventImpl(myManager); event.setParent(file); event.setFile(file); event.setGenericChange(generic); if (file instanceof PsiFileImpl && ((PsiFileImpl)file).isContentsLoaded()) { event.setOffset(0); event.setOldLength(file.getTextLength()); } return event; }