public static @Nullable VirtualFile asVirtualFile(@Nullable PsiElement element) {
    if (element instanceof PsiFileSystemItem psiFileSystemItem) {
      return psiFileSystemItem.isValid() ? psiFileSystemItem.getVirtualFile() : null;
    }
    return null;
  }
public static @Nullable VirtualFile asVirtualFile(@Nullable PsiElement element)