@Override
  public void contentsSynchronized() {
    Set<Language> languages = getLanguages();
    for (Iterator<Map.Entry<Language, PsiFileImpl>> iterator = myRoots.entrySet().iterator(); iterator.hasNext(); ) {
      Map.Entry<Language, PsiFileImpl> entry = iterator.next();
      if (!languages.contains(entry.getKey())) {
        PsiFileImpl file = entry.getValue();
        iterator.remove();
        DebugUtil.performPsiModification(getClass().getName() + " root change", () -> file.markInvalidated());
      }
    }
    super.contentsSynchronized();
  }
@Override
  public void contentsSynchronized()