static HighlightInfo.Builder checkReceiverType(@NotNull PsiReceiverParameter parameter) {
    PsiElement owner = parameter.getParent().getParent();
    if (!(owner instanceof PsiMethod method)) return null;

    PsiClass enclosingClass = method.getContainingClass();
    boolean isConstructor = method.isConstructor();
    if (isConstructor && enclosingClass != null) {
      enclosingClass = enclosingClass.getContainingClass();
    }

    if (enclosingClass != null) {
      PsiClassType type = PsiElementFactory.getInstance(parameter.getProject()).createType(enclosingClass, PsiSubstitutor.EMPTY);
      if (!type.equals(parameter.getType())) {
        PsiElement range = ObjectUtils.notNull(parameter.getTypeElement(), parameter);
        String text = JavaErrorBundle.message("receiver.type.mismatch");
        HighlightInfo.Builder info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(range).descriptionAndTooltip(text);
        IntentionAction action = QuickFixFactory.getInstance().createReceiverParameterTypeFix(parameter, type);
        info.registerFix(action, null, null, null, null);
        return info;
      }

      PsiThisExpression identifier = parameter.getIdentifier();
      if (!enclosingClass.equals(PsiUtil.resolveClassInType(identifier.getType()))) {
        String text = JavaErrorBundle.message("receiver.name.mismatch");
        HighlightInfo.Builder info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(identifier).descriptionAndTooltip(text);
        String name;
        if (isConstructor) {
          String className = enclosingClass.getName();
          name = className != null ? className + ".this" : null;
        }
        else {
          name = "this";
        }
        if (name != null) {
          IntentionAction action = QuickFixFactory.getInstance().createReceiverParameterNameFix(parameter, name);
          info.registerFix(action, null, null, null, null);
        }
        return info;
      }
    }

    return null;
  }
static HighlightInfo.Builder checkReceiverType(@NotNull PsiReceiverParameter parameter)