make sure WithTransient Package is always registered

Signed-off-by: Christian Dietrich <christian.dietrich@itemis.de>
This commit is contained in:
Christian Dietrich 2019-09-03 19:15:07 +02:00
parent 3072c95bee
commit d317854941
2 changed files with 28 additions and 0 deletions

View file

@ -7,6 +7,9 @@
*/
package org.eclipse.xtext.ide.tests.testlanguage
import com.google.inject.Injector
import org.eclipse.emf.ecore.EPackage
import org.eclipse.xtext.ide.tests.testlanguage.withtransient.WithtransientPackage
/**
* Initialization support for running Xtext languages without Equinox extension registry.
@ -16,4 +19,14 @@ class PartialSerializationTestLanguageStandaloneSetup extends PartialSerializati
def static void doSetup() {
new PartialSerializationTestLanguageStandaloneSetup().createInjectorAndDoEMFRegistration()
}
override register(Injector injector) {
super.register(injector)
if (!EPackage.Registry.INSTANCE.containsKey(
"http://www.eclipse.org/xtext/ide/tests/testlanguage/mm/withtransient")) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/ide/tests/testlanguage/mm/withtransient",
WithtransientPackage.eINSTANCE);
}
}
}

View file

@ -7,7 +7,10 @@
*/
package org.eclipse.xtext.ide.tests.testlanguage;
import com.google.inject.Injector;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.xtext.ide.tests.testlanguage.PartialSerializationTestLanguageStandaloneSetupGenerated;
import org.eclipse.xtext.ide.tests.testlanguage.withtransient.WithtransientPackage;
/**
* Initialization support for running Xtext languages without Equinox extension registry.
@ -17,4 +20,16 @@ public class PartialSerializationTestLanguageStandaloneSetup extends PartialSeri
public static void doSetup() {
new PartialSerializationTestLanguageStandaloneSetup().createInjectorAndDoEMFRegistration();
}
@Override
public void register(final Injector injector) {
super.register(injector);
boolean _containsKey = EPackage.Registry.INSTANCE.containsKey(
"http://www.eclipse.org/xtext/ide/tests/testlanguage/mm/withtransient");
boolean _not = (!_containsKey);
if (_not) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/ide/tests/testlanguage/mm/withtransient",
WithtransientPackage.eINSTANCE);
}
}
}