private boolean isVisible(@NotNull FileNode node, @Nullable VirtualFileFilter filter) {
    if (!node.file.isValid() || root.project.isDisposed()) return false;
    if (filter == null) return !root.isExcluded(node.file);
    ThreeState visibility = node.visibility;
    if (visibility == ThreeState.NO) return false;
    if (visibility == ThreeState.YES) return true;
    checkCanceled(); // ProcessCanceledException if current task is interrupted
    boolean visible = node.isVisible(filter, root);
    node.visibility = ThreeState.fromBoolean(visible);
    return visible;
  }
private boolean isVisible(@NotNull FileNode node, @Nullable VirtualFileFilter filter)