@Inject
private IHiddenTokenHelper hiddenTokenHelper;
@Override
protected void configureFormatting(FormattingConfig c) {
CssDslGrammarAccess f = (CssDslGrammarAccess) getGrammarAccess();
// It's usually a good idea to activate the following three statements.
// They will add and preserve newlines around comments
// c.setLinewrap(0, 1, 2).before(getGrammarAccess().getSL_COMMENTRule());
// c.setLinewrap(0, 1, 2).before(getGrammarAccess().getML_COMMENTRule());
// c.setLinewrap(0, 1, 1).after(getGrammarAccess().getML_COMMENTRule());
c.setSpace(" ").after(f.getCss_propertyRule());
//c.setSpace(" ").before(f.getCssTokRule());
//c.setSpace(" ").before(f.getIdentifierOrFuncTokRule());
//c.setSpace(" ").before(f.getNumberTokRule());
//c.setSpace(" ").before(f.getSymbolTokRule());
c.setSpace(" ").around(f.getSymbolTokRule());
for (Keyword semicolon : f.findKeywords(";")) {
c.setNoSpace().before(semicolon);
c.setLinewrap().after(semicolon);
}
for (Keyword colon : f.findKeywords(":")) {
c.setNoSpace().before(colon);
c.setSpace(" ").after(colon);
}
for (Pair<Keyword, Keyword> braces : f.findKeywordPairs("{", "}")) {
c.setIndentationIncrement().after(braces.getFirst());
c.setIndentationDecrement().before(braces.getSecond());
c.setLinewrap().after(braces.getFirst());