ASTNode (ASTNode first, ASTNode last, ASTNode anchor, Boolean before) { GrParameter[] params = getParameters(); ASTNode result = super.addInternal(first, last, anchor == null ? findChildByType(before ? T_RPAREN : T_LPAREN) : anchor, before); if (first == last && first.getPsi() instanceof GrParameter && params.length > 0) { if (before && anchor != null) { getNode().addLeaf(GroovyTokenTypes.mCOMMA, ",", anchor); } else if (before) { getNode().addLeaf(GroovyTokenTypes.mCOMMA, ",", result); } else if (anchor != null) { getNode().addLeaf(GroovyTokenTypes.mCOMMA, ",", result); } else { getNode().addLeaf(GroovyTokenTypes.mCOMMA, ",", result.getTreeNext()); } } return result; }