PsiExpression (@Nullable PsiExpression indexExpression) { if (indexExpression != null) { PsiElement parent = PsiUtil.skipParenthesizedExprUp(indexExpression.getParent()); if (parent instanceof PsiExpressionList) { PsiElement gParent = PsiUtil.skipParenthesizedExprUp(parent.getParent()); if (gParent instanceof PsiMethodCallExpression && PsiTreeUtil.isAncestor(extractIndexFromGetExpression((PsiExpression)gParent), indexExpression, false)) { return (PsiExpression)gParent; } } } return null; }