c.setLinewrap().before(ga.getCollectExpressionAccess().getRightCurlyBracketKeyword_1_2_2());
}
@Override
protected void configureFormatting(FormattingConfig c) {
PPGrammarAccess ga = (PPGrammarAccess) getGrammarAccess();
// not a good idea since non-parenthesised function calls are separate expressions,
// each 'statement' must do its own terminating linewrap
// c.setLinewrap().after(ga.getPuppetManifestAccess().getStatementsAssignment_2());
// Add add and preserve newlines around comments
c.setLinewrap(0, 1, 2).before(ga.getSL_COMMENTRule());
// NOTE: default set to 0 to allow "inline" comments like /* this one */ without requiring
// a linewrap.
c.setLinewrap(0, 0, 2).before(ga.getML_COMMENTRule());
c.setLinewrap(0, 0, 1).after(ga.getML_COMMENTRule());
stringExpressionConfiguration(c);
ifExpressionConfiguration(c);
caseExpressionConfiguration(c);
classExpressionConfiguration(c);
selectorExpressionConfiguration(c);
definitionExpressionConfiguration(c);
assignmentExpressionConfiguration(c);
importExpressionConfiguration(c);
literalListAndHashConfiguration(c);
functionCallConfiguration(c);
nodeExpressionConfiguration(c);
// commas
for(Keyword comma : ga.findKeywords(",")) {
c.setNoSpace().before(comma);
}
// TODO: Old formatter needs this fixed since there is no endComma rule - they are just optional commas in
// various expressions. They may be ok already with a general rule "no space before a comma keyword".
// c.setNoSpace().before(ga.getEndCommaRule());
// no space between unary operators (! -) and the following expression
c.setNoSpace().after(ga.getNotExpressionAccess().getExclamationMarkKeyword_0());
c.setNoSpace().after(ga.getUnaryMinusExpressionAccess().getHyphenMinusKeyword_0());
resourceExpressionConfiguration(c);
collectExpressionConfiguration(c);
atExpressionConfiguration(c);
parenthisedExpressionConfguration(c);