private static @Nullable PsiRecordComponent getComponent(@NotNull PsiReferenceExpression reference) {
    PsiMethodCallExpression call = ExpressionUtils.getCallForQualifier(reference);
    if (call != null) {
      PsiMethod method = call.resolveMethod();
      if (method instanceof LightRecordMethod recordMethod) {
        return recordMethod.getRecordComponent();
      }
      else if (method != null) {
        PsiClass aClass = method.getContainingClass();
        if (aClass != null && aClass.findFieldByName(method.getName(), false) instanceof LightRecordField recordField) {
          return recordField.getRecordComponent();
        }
      }
    }
    else if (PsiUtil.skipParenthesizedExprUp(reference.getParent()) instanceof PsiReferenceExpression ref &&
             ref.resolve() instanceof LightRecordField recordField) {
      return recordField.getRecordComponent();
    }
    return null;
  }
private static @Nullable PsiRecordComponent getComponent(@NotNull PsiReferenceExpression reference)