void (final PsiMethod method, final StringBuilder buffer, @Nullable GrOpenBlock block, GroovyPsiElement context) { final PsiParameterList list = method.getParameterList(); buffer.append("{ "); final PsiParameter[] parameters = list.getParameters(); Set<String> generatedNames = new HashSet<>(); if (parameters.length > 0) { final PsiParameter first = parameters[0]; final PsiType type = first.getType(); buffer.append(type.getCanonicalText()).append(" "); buffer.append(createName(generatedNames, first, type, context)); } for (int i = 1; i < parameters.length; i++) { buffer.append(", "); final PsiParameter param = parameters[i]; final PsiType type = param.getType(); buffer.append(type.getCanonicalText()).append(" "); String name = createName(generatedNames, param, type, context); buffer.append(name); } if (parameters.length > 0) { buffer.append(" ->"); } if (block != null) { final PsiElement lBrace = block.getLBrace(); final PsiElement rBrace = block.getRBrace(); for (PsiElement child = lBrace != null ? lBrace.getNextSibling() : block.getFirstChild(); child != null && child != rBrace; child = child.getNextSibling()) { buffer.append(child.getText()); } } buffer.append(" }"); }