Search in sources :

Example 1 with XbaseStandaloneSetup

use of org.eclipse.xtext.xbase.XbaseStandaloneSetup 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 XbaseStandaloneSetup

use of org.eclipse.xtext.xbase.XbaseStandaloneSetup 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 3 with XbaseStandaloneSetup

use of org.eclipse.xtext.xbase.XbaseStandaloneSetup 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

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 StandardTypeReferenceOwner (org.eclipse.xtext.xbase.typesystem.references.StandardTypeReferenceOwner)3 CommonTypeComputationServices (org.eclipse.xtext.xbase.typesystem.util.CommonTypeComputationServices)3