private static @NotNull ModCommandAction createAction(PsiVariable candidate, SmartPsiElementPointer<PsiMethodCallExpression> pointer) {
    return ModCommand.psiUpdateStep(
        candidate, requireNonNullElse(candidate.getName(), ""), (var, updater) -> {
          PsiMethodCallExpression call = updater.getWritable(pointer.getElement());
          if (call == null) return;
          replaceWithQualifier(var, call);
          updater.moveCaretTo(call.getTextOffset() + call.getTextLength());
        }, var -> requireNonNullElse(var.getNameIdentifier(), var).getTextRange())
      .withPresentation(p -> p.withIcon(candidate.getIcon(0)));
  }
private static @NotNull ModCommandAction createAction(PsiVariable candidate, SmartPsiElementPointer<PsiMethodCallExpression> pointer)