samedi 28 avril 2018

Referencing elements from other resource in Xtext web integration

I am using the web integration of Xtext (not the language server protocol implementation) via the XtextServlet in a Spring Boot based application to provide a web based editor for my DSL. This works so far. However, my language references other elements of the DSLs and I wonder whether I can somehow add a default model to the project so that those elements can be referenced from the web editor.

Assume following language:

Model:
    greetings+=Greeting*;

Greeting:
    'Hello' name=ID ('referencing' referencedGreeting=[Greeting])? '!'; 

Now I want to add the following file somehow to the project as default file:

Hello Test1!

So that someone can use the web editor and write:

Hello Test2 referencing Test1!

Apparently it is not enough to simply add the model file to the project's resource folder. Referencing elements in the same web editor works though. Any ideas or hints?

Thanks a lot!




Aucun commentaire:

Enregistrer un commentaire