Custom persistence - Import own languages
Hello MPS community.
Initial situation and requirements
I am currently working on a project where I am developing a standalone projectional editor for an existing language.
- The language already has a parser implemented in Java, which I want to use for reading the files and saving them.
- The files should be kept in their own format (custom persistence).
Approach
I have created two projects for this:
- Project A contains the languages and the build solution for the standalone IDE.
- Project B contains the plugin for the custom persistence, following the example of XmlSamplePersistence.
Project B imports the languages via Settings > Project Libraries.
In addition, the languages are imported in the buildscript via:
language MyLanguage
load from ./../Project A/languages/MyLanguage/MyLanguage.mpl
The plugin is successfully created and installed.
If I open my project A now, my languages are marked as read only and the message appears: Migration suspended. Some languages used in project are not deployed...
Question
I suspect that as I imported the languages into project B, they are provided by the plugin and this will cause a collision when opened in A.
The plugin should only use the languages to build the model and not make them available.
I would be grateful for further tips. :)
Please sign in to leave a comment.
This is normal, MPS can only load a given language once. If the language is loaded through the plugin and you then open a project containing that language, it won't be loaded again and the version from the plugin will be used. And since it's in a plugin, it is read only.
Thank you for your reply.
I was aiming at using my language from Project A in Project B to construct the Model.
Is there no way of importing a language into a plugin without providing the language to others?
If so I could only think of building the plugin in Project A as well to gain access to my languages.