private static @NotNull List<VirtualFile> getHierarchy(@NotNull VirtualFile file) {
    List<VirtualFile> result = new ArrayList<>();
    while (file != null) {
      result.add(file);
      file = file.getParent();
    }
    return result;
  }
private static @NotNull List<VirtualFile> getHierarchy(@NotNull VirtualFile file)