private static @Nullable PsiLocalVariable getVariableFromInitializer(PsiReferenceExpression ref) {
      PsiElement parent = PsiUtil.skipParenthesizedExprUp(ref.getParent());
      if (parent instanceof PsiLocalVariable variable) {
        return variable;
      }
      if (parent instanceof PsiMethodCallExpression &&
          PsiUtil.skipParenthesizedExprUp(parent.getParent()) instanceof PsiLocalVariable variable) {
        return variable;
      }
      return null;
    }
private static @Nullable PsiLocalVariable getVariableFromInitializer(PsiReferenceExpression ref)