Community
Participate
Working Groups
Build Identifier: 20100917-0705 For the attached grammar, format configuration and example the indentation keeps growing without the optional element. With the optional element the formatting works as expected. Reproducible: Always Steps to Reproduce: 1.Created MyDsl project with attached grammar and format configuration 2.Format attached example in the MyDsl editor - indent keeps growing 3.Uncomment "init" and format - expected result
Created attachment 188232 [details] MyDsl.xtext grammar
Created attachment 188233 [details] MyDsl format configuration
Created attachment 188235 [details] Example file
Created attachment 188236 [details] Graphviz diagram of format configuration
fixed in "master" and "Helios_maintenance". It turns out that the Matcher "lost track" when there is a parser rule with only optional syntactical elements. In case you have been accessing internals of Xtext's Matcher directly, there is one method that now has an additional parameter for loop protection: protected Pair<List<MatcherTransition>, List<MatcherState>> findTransitionPath(MatcherState from, AbstractElement to, boolean returning, boolean canReturn, Set<Pair<Boolean, MatcherState>> visited);
The class I was referring to is org.eclipse.xtext.formatting.impl.ElementMatcherProvider
Closing all bugs that were set to RESOLVED before Neon.0