Hi,
I am having to do a lot of code in active annotation processors where I have to write full class names in the source code for the generated Java code to compile, because there is no import statement generated. That means having to use the full classname everywhere:
body = ['''final «Promise.name» promise = new «Promise.name»();''']
Which ends up in quite ugly long full classname code in the generated Java.
I heard a trick that you can remove the closure brackets and use newTypeReference, like this:
body = '''final «Promise.newTypeReference» promise = new «Promise.newTypeReference»();'''
That works in some simple cases but not always. I get this errors like these: java.lang.IllegalStateException: Added adapter to resource set during code generation: org.eclipse.xtext.resource.CompilerPhases$IndexingAdapter@2a74a3c9
What would be the correct way to go about this?
Thank you,
Christian