@Override
  public @NotNull <R extends BuildRootDescriptor> Collection<R> findAllParentDescriptors(@NotNull File file,
                                                                                         @Nullable Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
                                                                                         @Nullable CompileContext context) {
    File current = file;
    List<R> result = null;
    int depth = 0;
    while (current != null) {
      List<R> descriptors = filterDescriptorsByFile(getRootDescriptors(current, types, context), file, depth);
      if (!descriptors.isEmpty()) {
        if (result == null) {
          result = descriptors;
        }
        else {
          result = new ArrayList<>(result);
          result.addAll(descriptors);
        }
      }
      current = FileUtilRt.getParentFile(current);
      depth++;
    }
    return result != null ? result : Collections.emptyList();
  }
@Override
  public @NotNull <R extends BuildRootDescriptor> Collection<R> findAllParentDescriptors(@NotNull File file,
                                                                                         @Nullable Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
                                                                                         @Nullable CompileContext context)