Use ALE's Message data structure to represent all validation errors. Xtext validators now return a List<Message> that is consumed by a DiagnosticsToEditorMarkerAdapter in order to create the relevant Eclipse markers.
As discussed in #160 this architecture will make easier to implement new features.
Changes
update Xtext validators produce a list of Message instead of IValidationMessage
enrich diagnostics.ecore metamodel with new possible errors
read error messages from src/org/eclipse/emf/ecoretools/ale/validation/ale_editor_messages.properties (core plug-in):
messages are centralized and easier to update
messages can be translated if needed
some error messages have been improved
Notes
existing unit tests for Xtext validators should be updated to make sure that they produce the right Message instances. That's however a lot of work, so for now I tricked them to check the markers created by the DiagnosticsToEditorMarkerAdapter instead. That allowed to updated tests quickly to the new architecture.
The code still has room for improvement (e.g. instantiation of Message instances is not very clean) but it works and allows for other issues to be solved. Let's merge and improve later.
Closes #160
Use ALE's
Message
data structure to represent all validation errors. Xtext validators now return aList<Message>
that is consumed by aDiagnosticsToEditorMarkerAdapter
in order to create the relevant Eclipse markers.As discussed in #160 this architecture will make easier to implement new features.
Changes
Message
instead ofIValidationMessage
diagnostics.ecore
metamodel with new possible errorssrc/org/eclipse/emf/ecoretools/ale/validation/ale_editor_messages.properties
(core
plug-in):Notes
Message
instances. That's however a lot of work, so for now I tricked them to check the markers created by theDiagnosticsToEditorMarkerAdapter
instead. That allowed to updated tests quickly to the new architecture.