@Override
  protected @Nullable Presentation getPresentation(@NotNull ActionContext context, @NotNull PsiParameter myParameter) {
    PsiType type = FieldFromParameterUtils.getType(myParameter);
    PsiClass targetClass = PsiTreeUtil.getParentOfType(myParameter, PsiClass.class);
    if (!FieldFromParameterUtils.isAvailable(myParameter, type, targetClass)) {
      return null;
    }
    Project project = context.project();
    PsiField field = findFieldToAssign(project, myParameter);
    if (field == null || !field.getType().isAssignableFrom(type)) return null;
    if (!field.getLanguage().isKindOf(JavaLanguage.INSTANCE)) return null;
    PsiElement scope = myParameter.getDeclarationScope();
    if (scope instanceof PsiMethod method) {
      PsiCodeBlock body = method.getBody();
      if (body == null) return null;
      if (!myIsFix && !VariableAccessUtils.variableIsUsed(myParameter, body)) {
        // for unused parameter there will be a separate quick fix
        return null;
      }
      if (field.hasModifierProperty(PsiModifier.FINAL)) {
        if (!JavaHighlightUtil.getChainedConstructors(method).isEmpty()) return null;
        try {
          ControlFlow flow =
            ControlFlowFactory.getInstance(project).getControlFlow(body, LocalsOrMyInstanceFieldsControlFlowPolicy.getInstance());
          if (!ControlFlowUtil.isVariableDefinitelyNotAssigned(field, flow)) return null;
        }
        catch (AnalysisCanceledException ignored) {
        }
      }
    }
    return Presentation.of(JavaBundle.message("intention.assign.field.from.parameter.text", field.getName()));
  }
@Override
  protected @Nullable Presentation getPresentation(@NotNull ActionContext context, @NotNull PsiParameter myParameter)