void (@NotNull PsiTreeChangeEventImpl event) { PsiTreeChangeEventImpl.PsiEventType code = event.getCode(); String propertyName = event.getPropertyName(); if (code == PROPERTY_CHANGED && (Strings.areSameInstance(propertyName, PsiTreeChangeEvent.PROP_UNLOADED_PSI) || Strings.areSameInstance(propertyName, PsiTreeChangeEvent.PROP_ROOTS) || Strings.areSameInstance(propertyName, PsiTreeChangeEvent.PROP_FILE_TYPES)) || code == CHILD_REMOVED && event.getChild() instanceof PsiDirectory) { myAllLanguagesTracker.incModificationCount(); return; } PsiElement[] elements = { event.getFile(), event.getParent(), event.getOldParent(), event.getNewParent(), event.getElement(), event.getChild(), event.getOldChild(), event.getNewChild()}; incLanguageModificationCount(Language.ANY); for (PsiElement o : elements) { if (o == null) continue; if (o instanceof PsiDirectory) continue; if (o instanceof PsiFile) { for (Language language : ((PsiFile)o).getViewProvider().getLanguages()) { incLanguageModificationCount(language); } } else { try { IElementType type = PsiUtilCore.getElementType(o); Language language = type != null ? type.getLanguage() : o.getLanguage(); incLanguageModificationCount(language); } catch (PsiInvalidElementAccessException e) { PsiDocumentManagerBase.LOG.warn(e); } } } }