@Nullable
  public static VirtualFile findValidParentAccurately(@NotNull FilePath filePath) {
    VirtualFile result = filePath.getVirtualFile();
    if (result != null) return result;

    String path = filePath.getPath();
    if (!ApplicationManager.getApplication().isReadAccessAllowed()) {
      result = LocalFileSystem.getInstance().refreshAndFindFileByPath(path);
      if (result != null) return result;
    }

    Pair<NewVirtualFile, NewVirtualFile> pair = VfsImplUtil.findCachedFileByPath(LocalFileSystem.getInstance(), path);
    return pair.first != null ? pair.first : pair.second;
  }
@Nullable
  public static VirtualFile findValidParentAccurately(@NotNull FilePath filePath)