|Supporting several versions of a DSL when using the DSL's eclipse plugin [message #1841191]
||Thu, 06 May 2021 06:41
| Gerrit Schulz
Registered: September 2017
we are using a Xtext based DSL to generate Java source files for our Java projects. During development the generation is done via the DSL's eclipse plugin, whereas, when building the projects via maven, it is done via the xtext-maven-plugin.
Now, when adding new features to the DSL or simply changing the way the Java source files are generated and therefore creating new versions of the DSL's Xtext project, we would like to specify which version of the DSL is to be used on a per-Java-project basis.
That's easy to achive for the generation of the Java source Files when building the projects with maven, as we can simply change the version of the xtext-maven-plugin's dependency to our DSL within the Java project's maven pom.
But during development, when the generation is done via the DSL's eclipse plugin, we only have a single version of the eclipse plugin installed, so that the very same version of the DSL is used for every Java project despite us wanting the generation to be done with an older version of our DSL for certain projects.
The only way to solve that problem, that we could come up with, is to have several versions of the DSL's eclipse plugin installed simultaneously, while using a different file extension for the model files for each version of the DSL. (project1.mydsl1, project2.mydsl2)
But that solution doesn't feel quite elegant, so we are wondering if there might be a better solution, where the eclipse plugin would support several versions of the DSL and one could configure the version of the DSL to be used on a per-Java-project basis.
Or maybe there is a solution with the help of the language server, where one would use a custom eclipse plugin that reads the version of the DSL to be used from the Java project and than accesses the correct version's language server for the source file generation as well as for syntax highlighting, code proposals and so on.
Thanks in advance for any reply.
Powered by FUDForum
. Page generated in 0.01416 seconds