@Override public Set<Binding> getGuiceBindingsRt(Grammar grammar) { BindFactory factory = new BindFactory(); if (!XbaseGeneratorFragment.doesUseXbase(grammar)) { if(isGenerateStub) { factory.addTypeToType(IScopeProvider.class.getName(), getScopeProviderName(grammar, getNaming())); } else { factory.addTypeToType(IScopeProvider.class.getName(), getLocalScopeProvider().getName()); } factory.addConfiguredBinding( IScopeProvider.class.getName() + "Delegate", "binder.bind(" + IScopeProvider.class.getName() + ".class" + ").annotatedWith(com.google.inject.name.Names.named(" + AbstractDeclarativeScopeProvider.class.getName() + ".NAMED_DELEGATE" + ")).to(" + getLocalScopeProvider().getName() + ".class)"); factory.addTypeToType(IGlobalScopeProvider.class.getName(), getGlobalScopeProvider().getName()); } factory.addConfiguredBinding(IgnoreCaseLinking.class.getSimpleName(), "binder.bindConstant().annotatedWith(" + IgnoreCaseLinking.class.getName() + ".class).to(" + isIgnoreCase() + ")"); return factory.getBindings(); }
protected ISetup lazyLinkingTestLangaugeSetup() { return new LazyLinkingTestLanguageStandaloneSetup() { @Override public Injector createInjector() { return Guice.createInjector(new org.eclipse.xtext.linking.lazy.LazyLinkingTestLanguageRuntimeModule() { @Override public void configureIResourceDescriptions(Binder binder) { binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).to( ProxyfyingResourceDecriptions.class); } @Override public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { return org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider.class; } }); } }; }
public ImportedNamespaceAwareLocalScopeProvider(IGlobalScopeProvider globalScopeProvider, IQualifiedNameProvider qualifiedNameProvider, IQualifiedNameConverter qualifiedNameConverter, ICaseInsensitivityHelper caseInsensitivityHelper) { super(globalScopeProvider, caseInsensitivityHelper); this.qualifiedNameProvider = qualifiedNameProvider; this.qualifiedNameConverter = qualifiedNameConverter; }
@Override public void generate() { if ((this.onlyEnabledIfGrammarIsUsed.get() && (!this.xbaseUsageDetector.inheritsXtype(this.getLanguage().getGrammar())))) { return; } new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef(IGlobalScopeProvider.class), TypeReference.typeRef("org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider")).contributeTo(this.getLanguage().getRuntimeGenModule()); GuiceModuleAccess _runtimeGenModule = this.getLanguage().getRuntimeGenModule(); _runtimeGenModule.setSuperClass(TypeReference.typeRef("org.eclipse.xtext.common.types.DefaultCommonTypesRuntimeModule")); new GuiceModuleAccess.BindingFactory().addTypeToType(TypeReference.typeRef("org.eclipse.xtext.ui.editor.contentassist.PrefixMatcher"), TypeReference.typeRef("org.eclipse.xtext.ui.editor.contentassist.FQNPrefixMatcher")).contributeTo(this.getLanguage().getEclipsePluginGenModule()); GuiceModuleAccess _eclipsePluginGenModule = this.getLanguage().getEclipsePluginGenModule(); _eclipsePluginGenModule.setSuperClass(TypeReference.typeRef("org.eclipse.xtext.common.types.ui.DefaultCommonTypesUiModule")); ManifestAccess _manifest = this.getProjectConfig().getRuntime().getManifest(); boolean _tripleNotEquals = (_manifest != null); if (_tripleNotEquals) { CollectionExtensions.<String>addAll(this.getProjectConfig().getRuntime().getManifest().getRequiredBundles(), "org.eclipse.xtext.common.types", "org.objectweb.asm;bundle-version=\"[5.0.1,6.0.0)\";resolution:=optional"); } ManifestAccess _manifest_1 = this.getProjectConfig().getRuntimeTest().getManifest(); boolean _tripleNotEquals_1 = (_manifest_1 != null); if (_tripleNotEquals_1) { this.getProjectConfig().getRuntimeTest().getManifest().getRequiredBundles().add( "org.objectweb.asm;bundle-version=\"[5.0.1,6.0.0)\";resolution:=optional"); } ManifestAccess _manifest_2 = this.getProjectConfig().getEclipsePlugin().getManifest(); boolean _tripleNotEquals_2 = (_manifest_2 != null); if (_tripleNotEquals_2) { this.getProjectConfig().getEclipsePlugin().getManifest().getRequiredBundles().add( "org.eclipse.xtext.common.types.ui"); } }
private void registerGuiceBindingsRt() { new GuiceModuleAccess.BindingFactory() .addTypeToType(typeRef(XtextResourceSet.class), typeRef(CooperateResourceSet.class)) .addTypeToType(typeRef(IGlobalScopeProvider.class), typeRef(CooperateGlobalScopeProvider.class)) .addTypeToType(typeRef(IGlobalScopeTypeQueryProvider.class), typeRef(CooperateGlobalScopeProvider.class)) .addTypeToType(typeRef(IUMLUriFinder.class), typeRef(ConventionalUMLUriFinder.class)) .addTypeToType(typeRef(IUMLPrimitiveTypeFilter.class), typeRef(DefaultUMLPrimitiveTypeFilter.class)) .contributeTo(getLanguage().getRuntimeGenModule()); getProjectConfig().getRuntime().getManifest().getRequiredBundles() .add("de.cooperateproject.modeling.textual.xtext.runtime;visibility:=reexport"); }
@Override public Set<Binding> getGuiceBindingsRt(final Grammar grammar) { return new BindFactory() .addTypeToInstance(ClassLoader.class.getName(), "getClass().getClassLoader()") .addTypeToInstance("org.eclipse.xtext.common.types.TypesFactory", "org.eclipse.xtext.common.types.TypesFactory.eINSTANCE") .addTypeToType("org.eclipse.xtext.common.types.access.IJvmTypeProvider.Factory", "org.eclipse.xtext.common.types.access.ClasspathTypeProviderFactory") .addTypeToType("org.eclipse.xtext.common.types.xtext.AbstractTypeScopeProvider", "org.eclipse.xtext.common.types.xtext.ClasspathBasedTypeScopeProvider") .addTypeToType(IGlobalScopeProvider.class.getName(), "org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider") .getBindings(); }
public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { return DefaultGlobalScopeProvider.class; }
@Override public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { return N4JSGlobalScopeProvider.class; }
public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { return TypesAwareDefaultGlobalScopeProvider.class; }
@Override public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { return DefaultGlobalScopeProvider.class; }
@Override public Set<Binding> getGuiceBindingsRt(Grammar grammar) { if (!usesXbaseGrammar(grammar)) return emptySet(); BindFactory config = new BindFactory() // overrides binding from org.eclipse.xtext.generator.exporting.QualifiedNamesFragment .addTypeToType(IQualifiedNameProvider.class.getName(), "org.eclipse.xtext.xbase.scoping.XbaseQualifiedNameProvider"); if (useInferredJvmModel) { config = config .addTypeToType(ILocationInFileProvider.class.getName(), "org.eclipse.xtext.xbase.jvmmodel.JvmLocationInFileProvider") .addTypeToType(IGlobalScopeProvider.class.getName(), "org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider") .addTypeToType("org.eclipse.xtext.xbase.validation.FeatureNameValidator", "org.eclipse.xtext.xbase.validation.LogicalContainerAwareFeatureNameValidator") .addTypeToType("org.eclipse.xtext.xbase.typesystem.internal.DefaultBatchTypeResolver", "org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareBatchTypeResolver") .addTypeToType("org.eclipse.xtext.xbase.typesystem.internal.DefaultReentrantTypeResolver", "org.eclipse.xtext.xbase.typesystem.internal.LogicalContainerAwareReentrantTypeResolver") .addTypeToType(IResourceValidator.class.getCanonicalName(), "org.eclipse.xtext.xbase.annotations.validation.DerivedStateAwareResourceValidator"); if(generateXtendInferrer) { config = config .addTypeToType("org.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer", getJvmModelInferrerName(grammar, getNaming())); } } else { config = config .addTypeToType(ILocationInFileProvider.class.getName(), "org.eclipse.xtext.xbase.resource.XbaseLocationInFileProvider"); } if (usesXImportSection(grammar)) { config = config.addConfiguredBinding( IScopeProvider.class.getName() + "Delegate", "binder.bind(" + IScopeProvider.class.getName() + ".class).annotatedWith(com.google.inject.name.Names.named(" + AbstractDeclarativeScopeProvider.class.getName() + ".NAMED_DELEGATE)).to("+ getImportScopeProvider(grammar)+")"); } return config.getBindings(); }
@Override public Set<Binding> getGuiceBindingsRt(Grammar grammar) { return new BindFactory() .addTypeToType(IGlobalScopeProvider.class.getName(), "org.eclipse.xtext.common.types.xtext.TypesAwareDefaultGlobalScopeProvider") .getBindings(); }
@Override protected Class<? extends IGlobalScopeProvider> getGlobalScopeProvider() { return DefaultGlobalScopeProvider.class; }
@Override protected Class<? extends IGlobalScopeProvider> getGlobalScopeProvider() { return ImportUriGlobalScopeProvider.class; }
@Override public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { return TypesAwareDefaultGlobalScopeProvider.class; }
public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { return ImportUriGlobalScopeProvider.class; }
protected AbstractGlobalScopeDelegatingScopeProvider(IGlobalScopeProvider globalScopeProvider, ICaseInsensitivityHelper caseInsensitivityHelper) { this.globalScopeProvider = globalScopeProvider; this.caseInsensitivityHelper = caseInsensitivityHelper; }