private static @Nullable PsiVariable findVariableByInitializer(@NotNull PsiExpression expression) {
    PsiElement parent = PsiUtil.skipParenthesizedExprUp(expression.getParent());
    if (parent instanceof PsiVariable variable && PsiTreeUtil.isAncestor(variable.getInitializer(), expression, false)) {
      return variable;
    }
    return null;
  }
private static @Nullable PsiVariable findVariableByInitializer(@NotNull PsiExpression expression)