static @Nullable VarUseContext from(@NotNull PsiReferenceExpression ref) {
      if (PsiUtil.isAccessedForWriting(ref)) {
        return Contexts.WRITING;
      }
      PsiMethodCallExpression call = ExpressionUtils.getCallForQualifier(ref);
      if (call != null) {
        String name = call.getMethodExpression().getReferenceName();
        if (name != null) {
          if (PropertyUtilBase.isSimplePropertySetter(call.resolveMethod())) {
            return Contexts.SETTER;
          }
          if (name.matches("add[A-Z].+")) {
            return Contexts.ADDER;
          }
          return new QualifierContext(name);
        }
      }
      PsiParameter parameter = MethodCallUtils.getParameterForArgument(ref);
      if (parameter != null && parameter.getDeclarationScope() instanceof PsiMethod method) {
        return new ArgumentContext(method.getName(), method.getParameterList().getParameterIndex(parameter));
      }
      PsiElement parent = PsiUtil.skipParenthesizedExprUp(ref.getParent());
      if (parent instanceof PsiIfStatement || parent instanceof PsiConditionalLoopStatement ||
          parent instanceof PsiPolyadicExpression poly &&
          TokenSet.create(JavaTokenType.ANDAND, JavaTokenType.OROR).contains(poly.getOperationTokenType())) {
        return Contexts.CONDITION;
      }
      return null;
    }
static @Nullable VarUseContext from(@NotNull PsiReferenceExpression ref)