void (@NotNull Editor editor, @NotNull GroovySmartEnterProcessor processor, @NotNull PsiElement psiElement) { final PsiElement parent = psiElement.getParent(); if (parent instanceof GrReferenceExpression && !(parent.getParent() instanceof GrMethodCall) && hasOnlyClosureParam((GrReferenceExpression)parent)) { final int endOffset = psiElement.getTextRange().getEndOffset(); editor.getDocument().insertString(endOffset, "{\n}"); } }