Community
Participate
Working Groups
Build Identifier: 20100917-0705 It's a bug related to a post in the xtext forum: http://www.eclipse.org/forums/index.php?t=msg&S=f99336c0482f91bbef398fc7a7547a8d&th=204862 With this grammar: Root : model+=MyModel* ; MyModel : head=Head "[" ( body=Body )? "]"; Head : name+=Tag ( ',' name+=Tag )* ; Tag : name+=TagImpl+; TagImpl : name=ID; Body : name+=BodyImpl+; BodyImpl : name=ID "=" (value=ID)? ";" ; and these formatting rules: c.setLinewrap().after ( g.getMyModelAccess().getLeftSquareBracketKeyword_1() ); c.setIndentationIncrement().after ( g.getMyModelAccess().getLeftSquareBracketKeyword_1() ); c.setLinewrap().before ( g.getMyModelAccess().getRightSquareBracketKeyword_3() ); c.setIndentationDecrement().before ( g.getMyModelAccess().getRightSquareBracketKeyword_3() ); c.setLinewrap().after ( g.getMyModelAccess().getRightSquareBracketKeyword_3() ); I expect something like: one , two three [ four = five ; ] six seven [ eight = nine ; ] but the result is: one , two three [ four = five ; ] six seven [ eight = nine ; ] The error happens when the "Head" model contains more than one "Tag" model, which is represented as a comma separated list. If "Head" is composed by only one "Tag" model containing several "TagImpl" models (so there's no commas) everything is correct. Reproducible: Always Steps to Reproduce: a) Include several "Tag" models in a "Head" model and the formatting is wrong b) With only one "Tag" model (no commas in "Head") the formatting is correct
It happens in Xtext 1.0.1 and 1.0.2
This bug is related to the deprecated formatter API.