Search in sources :

Example 1 with CodeConfig

use of org.eclipse.xtext.xtext.generator.CodeConfig in project xtext-core by eclipse.

the class XtextGenerator method initialize.

public void initialize() {
    if ((this.injector == null)) {
        XtextGenerator.LOG.info("Initializing Xtext generator");
        new StandaloneSetup().addRegisterGeneratedEPackage("org.eclipse.xtext.common.types.TypesPackage");
        this.initializeEncoding();
        this.injector = this.createInjector();
        this.injector.injectMembers(this);
        CodeConfig _instance = this.injector.<CodeConfig>getInstance(CodeConfig.class);
        final Procedure1<CodeConfig> _function = (CodeConfig it) -> {
            it.initialize(this.injector);
        };
        ObjectExtensions.<CodeConfig>operator_doubleArrow(_instance, _function);
        this.projectConfig.initialize(this.injector);
        this.cleaner.initialize(this.injector);
        this.standaloneSetup.initialize(this.injector);
        for (final XtextGeneratorLanguage language : this.languageConfigs) {
            {
                final Injector languageInjector = this.createLanguageInjector(this.injector, language);
                language.initialize(languageInjector);
            }
        }
    }
}
Also used : XtextGeneratorLanguage(org.eclipse.xtext.xtext.generator.XtextGeneratorLanguage) IXtextGeneratorLanguage(org.eclipse.xtext.xtext.generator.IXtextGeneratorLanguage) Injector(com.google.inject.Injector) XtextGeneratorStandaloneSetup(org.eclipse.xtext.xtext.generator.XtextGeneratorStandaloneSetup) XtextStandaloneSetup(org.eclipse.xtext.XtextStandaloneSetup) StandaloneSetup(org.eclipse.emf.mwe.utils.StandaloneSetup) CodeConfig(org.eclipse.xtext.xtext.generator.CodeConfig)

Aggregations

Injector (com.google.inject.Injector)1 StandaloneSetup (org.eclipse.emf.mwe.utils.StandaloneSetup)1 XtextStandaloneSetup (org.eclipse.xtext.XtextStandaloneSetup)1 CodeConfig (org.eclipse.xtext.xtext.generator.CodeConfig)1 IXtextGeneratorLanguage (org.eclipse.xtext.xtext.generator.IXtextGeneratorLanguage)1 XtextGeneratorLanguage (org.eclipse.xtext.xtext.generator.XtextGeneratorLanguage)1 XtextGeneratorStandaloneSetup (org.eclipse.xtext.xtext.generator.XtextGeneratorStandaloneSetup)1