void (@NotNull PsiExpression defToInline) { PsiElement parent = defToInline.getParent(); if (parent instanceof PsiAssignmentExpression) { PsiElement gParent = PsiUtil.skipParenthesizedExprUp(parent.getParent()); if (!(gParent instanceof PsiExpressionStatement)) { parent.replace(defToInline); return; } } parent.delete(); }