Community
Participate
Working Groups
[Maybe only of interest to a too small community of inept developers.] Xtext works primarily as a text to model; user enters text, another tool uses the model. Xtext also works backwards; a tool produces the model; Xtext displays text to user. If a tool produces an inadequate model, (multiple root, missing object, ...) serialization fails with obscure diagnostics. It would be helpful if serialization synthesized dummy error nodes, or comment wrappers, so that any loadable XMI file could be displayed to aid understanding/debugging. cf. GMF displays orphan artefacts as red boxes.
some context... with Xtext 1.0.x, the error messages are produced by the ConcteteSyntaxValidator. That works in the very most cases, but not in all. For example it doesn't work when assigned actions are involved. In those cases, the ParseTreeConstructor creates the error messages. Those are obscure, indeed. once bug 333976 "replace backtracking algorithm with declarative approach" is finished, however, there will be better error messages. Additionally to that I think that your suggestions to write out dummy error tokens can be a good idea. That way the user will always get some document by serializing a model and errors in the model will lead to syntax errors in the document.
I am very interested in this feature as well. See newsgroup posting: http://www.eclipse.org/forums/index.php/t/261200/
It's much easier to come up with proper information if you know the language and the tools. So I suggest if you have such a use case add respective validation rules.