MPS : Real-Time Preview of Generated Text

Hi! To MPS experts here, a few questions on the preview of the generated text.

We know that the current state is that the user need to manually trigger the generation. What I’d like to know is if the idea of a real-time preview of the generated code is possible? Or even practical?

Thanks!

1 Like

I guess you could trigger the action time-based, but I doubt it would be very useful. Even for trivial languages, the build takes too long to feel instant, and it always opens a new editor tab (even if another tab already contains the text output).

1 Like

Thank you for your reply. As for the utility or usefulness of it, one scenario that I wish it were possible is the improvement of the following: I’m in a sandbox, I’m creating an instance of a concept, and every now and then I need to trigger the preview manually to generate a text that follows a PlantUml syntax, which the PlantUml plug-in parses and displays as UML diagram. In this scenario, the concept editor remains open, same with the screen containing the generated text, and the diagram screen. This is extremely useful in real-time discussion with Business Analysts while doing requirements gathering, where you use your DSL and the BA looks at the diagram. I’m done with this basic setup. The only challenge really is the auto-preview.

Now, that’s in a sandbox. I assume the behavior is the same once the language has been built and converted into a plug-in or created with stand-alone IDE. (I have not yet built a plug-in or a stand-alone IDE since I’m having some minor issues)

I’d recommend to look at these two projects:

1 Like

I played with a sample project (EntityClassJava). Looks promising. It could save me a lot of time. Thanks a lot!

1 Like