Community
Participate
Working Groups
Build Identifier: I20090611-1540 A sensible step in plugin development based on Xtext is providing the User with a UI-action for generating from the currently open file. If this action is based on invoking the generated generator workflow, there is a clash of concepts. The MWEReader component by default gets the StandaloneSetup class as parameter. The latter creates the injector and registers the Resource factory. For a complete standalone invokation this is OK, however, if this method is called within the UI, a factory that is already registered gets overridden. org.eclipse.xtext.resource.IResourceFactory resourceFactory = injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class); Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(fileExtesion, resourceFactory); Now the question is, who is making the mistake: the developer who programmatically invokes the generated workflow (well, it is allowed, isn't it), rather than using the XPandFacade directly or the framework that assumes that a workflow is always invoked in a standalone environment (here again, is it a problem in the workflow definition or in the StandaloneSetup). Reproducible: Always
The IGenerator interface should be used to implement code generators, that work from within Eclipse and in Standalone.