Questions tagged [xtend]

Xtend is a statically typed programming language that transcompiles to Java. It aims to produce more readable code than traditional Java.

Xtend is a programming language that transcompiles to Java. It aims to produce more readable code than traditional Java by reducing the amount of boilerplate code. It is developed by the Eclipse foundation.

415 questions
1
vote
1 answer

cannot convert from Iterable> to int[][]

When I print (0..1).map[i | (0..1).map[j | j]] I get [[0, 1], [0, 1]] as output. But when I want to assign it to a 2d int array val int[][] mat = (1..2).map[i | (1..2).map[j | i * j]] I get the error message Type mismatch: cannot convert from…
Christoph S.
  • 585
  • 3
  • 16
1
vote
1 answer

Xtext Parse text using another parser rule than the top one

For testing purposes, I would like to parse a stand-alone expression in my Xtext language. In my tests, I can parse a complete model using a ParseHelper, e.g., val model = parseHelper.parse('''function { 1 + 2 }''') Is it possible to parse a…
Safron
  • 802
  • 1
  • 11
  • 23
1
vote
1 answer

Eclipse launch error shows org.osgi.framework.BundleException

I have the following error during my generator development. I tried several times to refresh my workspace but it'd not worked. org.osgi.framework.BundleException: Could not resolve module: org.artop.ecuc.gautosar.accessors.check…
Thảo M. Hoàng
  • 1,224
  • 3
  • 20
  • 42
1
vote
0 answers

Eclipse editor keeps hanging when editing Xtend files ( 'updating editor state (sleeping)' )

Recently, my Eclipse editor started becoming really sluggish when editing Xtend files. I am using Xtend in the context of the Xtext framework (which provides certain interfaces using Xtend). I thought it had something to do with my Eclipse…
Jos B.
  • 27
  • 5
1
vote
2 answers

How to configure source compatbility level for xtend-maven-plugin?

Follow-up of Is there a P2 repository with an up-to-date javassist? The issue I have is related to Java lambdas. I am also using xtend, and xtend lambdas are generated as Java lambdas if source level compatibility is set to Java 8+, but as anonymous…
kutschkem
  • 7,826
  • 3
  • 21
  • 56
1
vote
1 answer

How to save an EMF Model

I am trying to save an EMF model with extension .xmi. But unable to do so, as I couldn't see any error neither in development nor in runtime. If I save it at default location which is…
1
vote
1 answer

How to handle package name changes in Java, if both versions need to be supported?

I need to support two versions of a dependency, which have the same API but different package names. How do I handle this without maintaining two versions of my code, with the only change being the import statement? For local variables, I guess I…
kutschkem
  • 7,826
  • 3
  • 21
  • 56
1
vote
1 answer

Code Generator doGenerate does not generate code to txt-file in Example Xtext Project

I am trying to understand how code generator doGenerate invokes. I took an example Xtext Project without any custom changes (only Greetings). By Default code generator looks like this: override void doGenerate(Resource resource, IFileSystemAccess2…
grüBer
  • 25
  • 4
1
vote
0 answers

Tutorial for using sirius Modeling with Xtext

I have created an xtext project from the tutorial given by their main site, but I want to integrate Sirius with the xtext project so that I can edit a diagram or the dsl file itself with each edit reflecting on the other editor view also with code…
1
vote
1 answer

How to build an Xtext Eclipse plug-in with Gradle?

I have written a DSL with Xtext 2.12 and my Xtend 2.12 code generator produces Java 8 code from it. I am using Eclipse Oxygen.3a. I started by creating an Xtext project as an Eclipse plug-in and all works fine, but I would like to have everything…
Georgie
  • 77
  • 6
1
vote
2 answers

Xbase Interpreter: Could not access field on instance: null

I am testing the idea of making my dsl Jvm compatible and I wanted to test the possibility of extending Xbase and using the interpreter. I have tried to make a minimal test project to use with the interpreter but I am getting a runtime error. I…
Zannith
  • 429
  • 4
  • 21
1
vote
1 answer

auto-generated java files in Eclipse

How to understand which are the auto-generated files in a huge Java project developed in Eclipse? I am a newbie. For example, little by little, I am discovering that many files are generated by using xcore plug-in. Other with xtend. Just going…
Leos313
  • 5,152
  • 6
  • 40
  • 69
1
vote
1 answer

Xtext: Couldn't resolve reference to JvmType MyGeneratorModule

I am copying the structure of the example Xtext Web project for multiple dsl's using the Entities and StateMachine example. I am using Gradle as my build system. I have a class MyGeneratorModule in both of my grammar projects. In my workflow I…
Zannith
  • 429
  • 4
  • 21
1
vote
1 answer

Xtext, how to properly extend DefaultAntlrTokenToAttributeIdMapper

I am trying to provide id mapping for our web editor context for things such as detecting whether a region is hoverable or not. From my reading I figured the place to do this was with AntlrTokenToAttributeIdMapper and not HighlightingCalculator.…
Zannith
  • 429
  • 4
  • 21
1
vote
1 answer

How do I properly use IdeContentProposalProvider for xtext web editor

I am having trouble getting my proposal provider to work properly. My objective is to provide a list of all possible imports a user can create. I can verify that the class is bound properly and is getting called on assist request from the editor. I…
Zannith
  • 429
  • 4
  • 21