void (@NotNull Project project, @NotNull PsiElement startElement, @NotNull ModPsiUpdater updater) { final PsiPrefixExpression prefixExpr = ObjectUtils.tryCast(startElement.getParent(), PsiPrefixExpression.class); if (prefixExpr == null) { return; } final PsiExpression oldExpr; final PsiExpression operand; if (myMinusOnTheLeft) { final PsiPrefixExpression child = ObjectUtils.tryCast(PsiUtil.skipParenthesizedExprDown(prefixExpr.getOperand()), PsiPrefixExpression.class); if (child == null) { return; } oldExpr = prefixExpr; operand = child.getOperand(); } else { final PsiPrefixExpression parent = ObjectUtils.tryCast(PsiUtil.skipParenthesizedExprUp(prefixExpr.getParent()), PsiPrefixExpression.class); if (parent == null) { return; } oldExpr = parent; operand = prefixExpr.getOperand(); } if (operand == null) { return; } PsiReplacementUtil.replaceExpression(oldExpr, operand.getText()); }