Customization of error messages
There were requests for language designers to be able to the possibility to customize some of MPS error messages (https://youtrack.jetbrains.net/issue/MPS-9668, https://youtrack.jetbrains.net/issue/MPS-23408)
As of this release, all the constraints error reporting could be modified.
We are planning to make the customization of reporting for other kinds of errors available in the next releases.
New aspect named 'feedback' is available for that the purpose .
of error text customization.
Image AddedNote that you can define your own custom feedback by extending the given set of feedback languages: for instance, you might describe a feedback which highlights edges or vertices
in the diagram editor.
As for 2019.2, only the default feedback 'ShowMessage' is available in MPS.
The feedback 'ShowMessage' defines the text you see in the tooltip when you move the mouse cursor over the node with the problem.
In order to modify the messages for the failing canBeChild, canBeParent, canBeAncestor, canBeRoot constraints functions you can use
the new constraints-rules languages (see below).
Rules constraints language
Just create a new root of the concept 'RulesConstraintsRoot' in the model 'constraints' of your language.
In this root you can describe the logic which is usually given in the constraints root in the canBe* functions.
The new language for describing constraints is more declarative and supposed to simplify the life of language designer by encouraging to write simpler and more modular
rules instead of java-like concept functions which are also still available in the root ConceptConstraints.
So far, the new root RuleConstraintsRoot does not allow to define scopes and property constraints, so this functionality needs to be considered as experimental.
Until there is a proper replacement for scopes and properties in the language, the root ConceptConstraints will be the legal way to define constraints in your language.
Typechecking Façade API
As of this release, the new facade API is the only supported way to run typechecking queries.