@Override
  public @Nullable <R extends BuildRootDescriptor> R findParentDescriptor(@NotNull File file, @NotNull Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
                                                                          @Nullable CompileContext context) {
    File current = file;
    int depth = 0;
    while (current != null) {
      final List<R> descriptors = filterDescriptorsByFile(getRootDescriptors(current, types, context), file, depth);
      if (!descriptors.isEmpty()) {
        return descriptors.get(0);
      }
      current = FileUtilRt.getParentFile(current);
      depth++;
    }
    return null;
  }
@Override
  public @Nullable <R extends BuildRootDescriptor> R findParentDescriptor(@NotNull File file, @NotNull Collection<? extends BuildTargetType<? extends BuildTarget<R>>> types,
                                                                          @Nullable CompileContext context)