PsiExpression (@NotNull PsiUnaryExpression element) { final PsiStatement statement = PsiTreeUtil.getParentOfType(element, PsiStatement.class); if (statement == null) return null; if (statement instanceof PsiLoopStatement) { return element; } final CodeBlockSurrounder surrounder = CodeBlockSurrounder.forExpression(element); if (surrounder == null) return null; final CodeBlockSurrounder.SurroundResult result = surrounder.surround(); return result.getExpression(); }