Search in sources :

Example 1 with CommonTypeComputationServices

use of org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices in project xtext-xtend by eclipse.

the class TypeBasedSimpleBenchmark method setUp.

@Override
protected void setUp() throws Exception {
    Injector injector = new XbaseStandaloneSetup().createInjectorAndDoEMFRegistration();
    XtextResourceSet resourceSet = new XtextResourceSet();
    ClassLoader loader = getClass().getClassLoader();
    resourceSet.setClasspathURIContext(loader);
    typeProvider = new ClasspathTypeProvider(loader, resourceSet, indexedAccess, null);
    CommonTypeComputationServices services = injector.getInstance(CommonTypeComputationServices.class);
    owner = new StandardTypeReferenceOwner(services, resourceSet);
}
Also used : XbaseStandaloneSetup(org.eclipse.xtext.xbase.XbaseStandaloneSetup) Injector(com.google.inject.Injector) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) CommonTypeComputationServices(org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices) ClasspathTypeProvider(org.eclipse.xtext.common.types.access.impl.ClasspathTypeProvider) StandardTypeReferenceOwner(org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner)

Example 2 with CommonTypeComputationServices

use of org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices in project xtext-xtend by eclipse.

the class DeferredTypeParameterHintCollectorTest method createOwner.

@Override
protected StandardTypeReferenceOwner createOwner() {
    CommonTypeComputationServices _services = this.getServices();
    ResourceSet _contextResourceSet = this.getContextResourceSet();
    return new StandardTypeReferenceOwner(_services, _contextResourceSet) {

        @Override
        public void acceptHint(final Object handle, final LightweightBoundTypeArgument boundTypeArgument) {
            DeferredTypeParameterHintCollectorTest.this.hints.put(handle, boundTypeArgument);
        }

        @Override
        public List<LightweightBoundTypeArgument> getAllHints(final Object handle) {
            return DeferredTypeParameterHintCollectorTest.this.hints.get(handle);
        }

        @Override
        public boolean isResolved(final Object handle) {
            return false;
        }
    };
}
Also used : CommonTypeComputationServices(org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) StandardTypeReferenceOwner(org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner) LightweightBoundTypeArgument(org.eclipse.xtext.xbase.typesystem.references.LightweightBoundTypeArgument)

Example 3 with CommonTypeComputationServices

use of org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices in project xtext-xtend by eclipse.

the class ConvertToArrayBenchmark method setUp.

@Override
protected void setUp() throws Exception {
    Injector injector = new XbaseStandaloneSetup().createInjectorAndDoEMFRegistration();
    XtextResourceSet resourceSet = new XtextResourceSet();
    ClassLoader loader = getClass().getClassLoader();
    resourceSet.setClasspathURIContext(loader);
    ClasspathTypeProvider typeProvider = new ClasspathTypeProvider(loader, resourceSet, indexedAccess, null);
    CommonTypeComputationServices services = injector.getInstance(CommonTypeComputationServices.class);
    StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(services, resourceSet);
    typeReference = type.getReference(typeProvider, owner);
    EcoreUtil.resolveAll(resourceSet);
}
Also used : XbaseStandaloneSetup(org.eclipse.xtext.xbase.XbaseStandaloneSetup) Injector(com.google.inject.Injector) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) CommonTypeComputationServices(org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices) ClasspathTypeProvider(org.eclipse.xtext.common.types.access.impl.ClasspathTypeProvider) StandardTypeReferenceOwner(org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner)

Example 4 with CommonTypeComputationServices

use of org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices in project xtext-xtend by eclipse.

the class ParameterizedTypeReferenceBenchmark method setUp.

@Override
protected void setUp() throws Exception {
    Injector injector = new XbaseStandaloneSetup().createInjectorAndDoEMFRegistration();
    XtextResourceSet resourceSet = new XtextResourceSet();
    ClassLoader loader = getClass().getClassLoader();
    resourceSet.setClasspathURIContext(loader);
    ClasspathTypeProvider typeProvider = new ClasspathTypeProvider(loader, resourceSet, indexedAccess, null);
    CommonTypeComputationServices services = injector.getInstance(CommonTypeComputationServices.class);
    StandardTypeReferenceOwner owner = new StandardTypeReferenceOwner(services, resourceSet);
    typeReference = type.getReference(typeProvider, owner);
    EcoreUtil.resolveAll(resourceSet);
}
Also used : XbaseStandaloneSetup(org.eclipse.xtext.xbase.XbaseStandaloneSetup) Injector(com.google.inject.Injector) XtextResourceSet(org.eclipse.xtext.resource.XtextResourceSet) CommonTypeComputationServices(org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices) ClasspathTypeProvider(org.eclipse.xtext.common.types.access.impl.ClasspathTypeProvider) StandardTypeReferenceOwner(org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner)

Aggregations

StandardTypeReferenceOwner (org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner)4 CommonTypeComputationServices (org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices)4 Injector (com.google.inject.Injector)3 ClasspathTypeProvider (org.eclipse.xtext.common.types.access.impl.ClasspathTypeProvider)3 XtextResourceSet (org.eclipse.xtext.resource.XtextResourceSet)3 XbaseStandaloneSetup (org.eclipse.xtext.xbase.XbaseStandaloneSetup)3 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)1 LightweightBoundTypeArgument (org.eclipse.xtext.xbase.typesystem.references.LightweightBoundTypeArgument)1