Community
Participate
Working Groups
Build Identifier: Xtext 1.0.0.v201006170321 The extension for the extension point "org.eclipse.emf.ecore.extension_parser" is currently created in the plugin.xml of the DSL UI plugin and the according factory is also in src-gen of the UI plugin. As parsing an Xtext resource should also be possible in a headless application (i.e. one without any UI related plugins), this extension should be moved to the DSL core plugin instead. This will involve moving the class AbstractGuiceAwareExecutableExtensionFactory as well, but as there are no dependencies to any UI classes, this should imho be no problem. Reproducible: Always Steps to Reproduce: 1. create a new Xtext project
The problem is that we need to use the guice Injector from the UI project in order to instantiate any components.
Couldn't there be different injectors being used for core and UI plugin? The core injector should then be something similar to what is done in the standalone setup method. Do you have any other suggestion about how to get resources loaded if the UI plugin is not present?
The ResourceFactory needs to be constructed by the injector from the UI bundle, because it needs components which live there (i.e. resources based container manager, etc.). If you don't want the UI bundle you could: 1) initialize programmatically using the standalone setup. 2) create a third bundle which contains the runtime extensions points only and maintains the injector. I'm closing this as won't fix as sufficient workarounds are available and the use case is rare. Please reopen if I've missed anything.
see last comment
This is a pain point for using Xtext in a Headless Eclipse Product - no plans to address this? We can probably "hack" something so that in the UI variant of our Product we use the Xtext UI plug-ins, and in the headless variant we use Standalone, or (... somehow...) custom Guice modules which initialize Xtext for use within Eclipse but without the UI parts. It would be nicer if Xtext offered this out of the box of course..
*** Bug 545238 has been marked as a duplicate of this bug. ***