public static @Nullable PsiElement prevLeaf(@NotNull PsiElement current) {
    while (true) {
      if (current instanceof PsiFileSystemItem) return null;
      PsiElement prevSibling = current.getPrevSibling();
      if (prevSibling != null) return lastChild(prevSibling);
      PsiElement parent = current.getParent();
      if (parent == null || parent instanceof PsiFile) return null;
      current = parent;
    }
  }
public static @Nullable PsiElement prevLeaf(@NotNull PsiElement current)