Search code examples
xtextxtend

Always add a specific 'import static extension' to an XText DSL


I am writing my own XText DSL and at some point I use a XBlockExpression where I can write any code I want. For this code, I want to use some operator overloading which I provide with a "import static extension ..." import. However, this makes the DSL look not perfectly nice as I would like to avoid this additional line on top of each file. Is there a way how I can by default trigger the functionality of a "import static extension ..." without explicitly writing it down?


Solution

  • did you consider to simply extend org.eclipse.xtext.xbase.scoping.batch.ImplicitlyImportedFeatures.getExtensionClasses()