public static void assertTreeLoadingAllowed(@NotNull VirtualFile file) {
    if (file instanceof VirtualFileWindow || !Registry.is("ast.loading.filter", false)) {
      return;
    }
    Supplier<String> disallowedInfo = myDisallowedInfo.get();
    if (disallowedInfo == null) {
      // loading was not disabled in current thread
    }
    else if (myForcedAllowedFiles.get().contains(file)) {
      // loading was disabled but then re-enabled for file
    }
    else {
      AstLoadingException throwable = new AstLoadingException();
      LOG.error("Tree access disabled", throwable, new Attachment("debugInfo", buildDebugInfo(file, disallowedInfo)));
    }
  }
public static void assertTreeLoadingAllowed(@NotNull VirtualFile file)