@NotNull
  @Override
  public Object createAnchor(@NotNull Object element) {
    if (element instanceof PsiElement psi) {
      return ReadAction.compute(() -> {
        if (!psi.isValid()) return psi;
        return SmartPointerManager.getInstance(psi.getProject()).createSmartPsiElementPointer(psi);
      });
    }
    return super.createAnchor(element);
  }
@NotNull
  @Override
  public Object createAnchor(@NotNull Object element)