xtend

How to add cascading content assist in Xtext document

佐手、 提交于 2019-12-11 16:03:33
问题 I want to add cascading content assist while creating an array of pre-defined values. When I'm creating the array, it should first give me the assist to add only '{'. After that it should suggest me the list of pre-defined values and a '}'. If I choose a value, it should suggest me to add a comma, then repeat the above step. It should keep suggesting me these until I add a closing brace. Currently I'm able to provide content-assist for only one element in the array. An example of desired

Xtext 2.9 scope provider

假装没事ソ 提交于 2019-12-10 14:52:19
问题 Xtext 2.9 changed the way scope providers work and I don't understand how they work now. Let's say I have the following grammar: grammar org.xtext.example.mydsl.MyDsl with org.eclipse.xtext.common.Terminals generate myDsl "http://www.xtext.org/example/mydsl/MyDsl" Model: ((things+=Thing) | (refs+=Reference))* ; Thing: 'thing' name=ID '{' stuff += Stuff* '}' ; Stuff: 'stuff' name=ID ; Reference: 'reference' thing=[Thing] stuff=[Stuff] ; For the Reference clause to work, I need a scope provider

Saving self-written code - xtend

試著忘記壹切 提交于 2019-12-08 06:43:09
问题 I want to know if it is possible to save self-written code within a generated file. If you change the model and then push the save button, all code is overwritten. I want to save some of the code of the old file. 回答1: Xtend uses a source generating compiler thus the produced Java code for Xtend itself cannot be altered on the source level. Nevertheless, if you use Xtend's template expression to generate code, you can of course insert protected regions to allow users to modify the generated

Saving self-written code - xtend

核能气质少年 提交于 2019-12-07 15:32:32
I want to know if it is possible to save self-written code within a generated file. If you change the model and then push the save button, all code is overwritten. I want to save some of the code of the old file. Xtend uses a source generating compiler thus the produced Java code for Xtend itself cannot be altered on the source level. Nevertheless, if you use Xtend's template expression to generate code, you can of course insert protected regions to allow users to modify the generated code. This OS project on Github implements support for protected regions in Xtend. 来源: https://stackoverflow

How can I use Eclipse's new Xtend language in my Android project?

◇◆丶佛笑我妖孽 提交于 2019-12-03 07:08:03
问题 I'd like to write Java classes in the Xtend language (simply because its way more terse), and have it compile back down into Java classes of which I can use in my Java project. Just like coffeescript. How can I do this? I tried creating an Xtend file just as I would do with a new class, however I get this error: Mandatory library bundle 'org.eclipse.xtext.xbase.lib' not found on the classpath. This disables intellisense (autocompletion). Also, even if I do get that working, how can I have it

How can I use Eclipse's new Xtend language in my Android project?

故事扮演 提交于 2019-12-02 20:41:05
I'd like to write Java classes in the Xtend language (simply because its way more terse), and have it compile back down into Java classes of which I can use in my Java project. Just like coffeescript. How can I do this? I tried creating an Xtend file just as I would do with a new class, however I get this error: Mandatory library bundle 'org.eclipse.xtext.xbase.lib' not found on the classpath. This disables intellisense (autocompletion). Also, even if I do get that working, how can I have it compile to a Java class? Having tried the same thing, I can confirm that enabling the Xtend Nature and

Load EMF Model instance in XTend

删除回忆录丶 提交于 2019-11-30 09:14:58
I am building a code generator in XTend where I already have an input model and meta model. That is, I use ATL to generate the input model for my XTend code generator (as part of a transformation sequence to gradually lower the abstraction level, instead of at once; this is the reason i'm not using xtext to create the syntax). So to be very clear, my input model for the code generator is a file in XMI format and NOT in the grammar of the xtext project (not even using that)! And i think this is causing me problems/confusion. I created a new XText project using Existing models, right clicked on

Load EMF Model instance in XTend

此生再无相见时 提交于 2019-11-29 13:04:31
问题 I am building a code generator in XTend where I already have an input model and meta model. That is, I use ATL to generate the input model for my XTend code generator (as part of a transformation sequence to gradually lower the abstraction level, instead of at once; this is the reason i'm not using xtext to create the syntax). So to be very clear, my input model for the code generator is a file in XMI format and NOT in the grammar of the xtext project (not even using that)! And i think this