Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Templates for Xtext
Templates for Xtext [message #875429] Tue, 22 May 2012 18:36 Go to next message
Zlatka Manas is currently offline Zlatka ManasFriend
Messages: 26
Registered: March 2012
Junior Member
Hi,
I want to define some XText templates for my DSL but in Preferences for Eclipse I don't find the section Xtext Languages -> YourDSL -> Templates . In Preferences under Xtext I have only Syntax coloring and Templates (general template, not one for my DSL).
Am I missing something? Any idea on this?

Thanks,
Zlatka
Re: Templates for Xtext [message #875443 is a reply to message #875429] Tue, 22 May 2012 19:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Hi,

make sure you have fragment = templates.CodetemplatesGeneratorFragment {} added to your workflow.
and do not forget to merge plugin.xml_gen to plugin.xml

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Templates for Xtext [message #875447 is a reply to message #875443] Tue, 22 May 2012 19:17 Go to previous messageGo to next message
Zlatka Manas is currently offline Zlatka ManasFriend
Messages: 26
Registered: March 2012
Junior Member
The fragment is in the workflow.
Maybe it is a stupid question, but how do you merge the xml's?

Thanks for the reply.
Zlatka
Re: Templates for Xtext [message #875459 is a reply to message #875447] Tue, 22 May 2012 19:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Copy & paste the contents add readd the manual changes you did to the plugin.xml yourself

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Templates for Xtext [message #875465 is a reply to message #875459] Tue, 22 May 2012 19:50 Go to previous messageGo to next message
Zlatka Manas is currently offline Zlatka ManasFriend
Messages: 26
Registered: March 2012
Junior Member
I haven't done any changes to the file and the files are the same. So copying the contents will not make any change.
Re: Templates for Xtext [message #875469 is a reply to message #875465] Tue, 22 May 2012 19:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
Then i do not understand what is wrong with your project.
which Xtext Version do you use?
does it work for a new mydsl project?
what are the steps you are doing?

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Templates for Xtext [message #875477 is a reply to message #875469] Tue, 22 May 2012 20:22 Go to previous messageGo to next message
Zlatka Manas is currently offline Zlatka ManasFriend
Messages: 26
Registered: March 2012
Junior Member
XText 2.0.1

I have one project for the ecore model and the genmodel. I create the model code from the genmodel.
Then I created a Xtext project and I have defined a grammar which imports the ecore model.
In the workflow I added this
fragment = parser.antlr.XtextAntlrGeneratorFragment {
options = {
backtrack = true
}
}

fragment = parser.antlr.XtextAntlrUiGeneratorFragment {
options = {
backtrack = true
}
}
and then I generate the artifacts.
then I start a new eclipse application and I use the editor.

With a new Xtext project and having the grammar generated from Xtext based on the model, the same thing happens (with no changes in the workflow). I do not see that section in Preferences.

Any ideas?

Re: Templates for Xtext [message #875479 is a reply to message #875477] Tue, 22 May 2012 20:25 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
I use Xtext 2.2.1

(1) create new Xtext project with the Wizard
(2) start runtime eclipse
(3) Window -> Preferences -> Mydsl -> Templates

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Templates for Xtext [message #875482 is a reply to message #875479] Tue, 22 May 2012 20:30 Go to previous message
Zlatka Manas is currently offline Zlatka ManasFriend
Messages: 26
Registered: March 2012
Junior Member
With a new (default) Xtext project, it shows the section in Preferences.
I will try with updating Xtext and starting fresh in a clean workspace.

Thanks for the help.
Zlatka
Previous Topic:[Xtext 2.3] Using the new debugging features
Next Topic:weird bundle dependencies generated
Goto Forum:
  


Current Time: Thu Mar 28 08:04:40 GMT 2024

Powered by FUDForum. Page generated in 0.03804 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top