|Re: Serialization/Formatter Problem [message #1005492 is a reply to message #1005415]
||Fri, 25 January 2013 16:52
| Christian Schlegel
Registered: September 2012
After troubleshooting the whole day, i found the bug (maybe it is not). Because of my external lexer, i redefined simple terminal rules like whitespaces and did not import the xtext default terminals in my xtext grammar. Because i do not like shortcuts i renamed the WS terminal rule to WHITESPACE. This caused the "formatterTokenStream.hiddenTokenHelper" in "org.eclipse.xtext.parsetree.reconstr.Serializer#60" to have an "wsRule" with null. Thus, no whitespces where put between tokens on serialization. After i renamed the temrinal rule to WS, "wsRule" (from above) is defined and serilization and formatting works well.
So my questions are - is it allowd to rename the WS terminal rule at all in an xtext grammar? Maybe is this a special case, only if one uses an external lexer? Or is this a general bug and should i report it?
Edit: Ok. Now i recognized the function setWhitespaceRule in the FormatterConfig and everthing is clear. Stupid me!
[Updated on: Fri, 25 January 2013 19:26]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.03864 seconds