void (@NotNull PsiElement scope) { if (!shouldFirePhysicalPsiEvents(scope)) { getPsiManager().beforeChange(false); return; } PsiTreeChangeEventImpl event = new PsiTreeChangeEventImpl(getPsiManager()); event.setParent(scope); event.setFile(scope.getContainingFile()); TextRange range = scope.getTextRange(); event.setOffset(range == null ? 0 : range.getStartOffset()); event.setOldLength(scope.getTextLength()); // the "generic" event is being sent on every PSI change. It does not carry any specific info except the fact that "something has changed" event.setGenericChange(true); getPsiManager().beforeChildrenChange(event); }