use of org.eclipse.n4js.resource.OrderedResourceDescriptionsData in project n4js by eclipse.
the class N4JSRuntimeCore method installIndex.
private void installIndex(ResourceSet resourceSet) {
// Fill index
ResourceDescriptionsData index = new OrderedResourceDescriptionsData(Collections.<IResourceDescription>emptyList());
List<Resource> resources = Lists.newArrayList(resourceSet.getResources());
for (Resource resource : resources) {
index(resource, resource.getURI(), index);
}
Adapter existing = EcoreUtil.getAdapter(resourceSet.eAdapters(), ResourceDescriptionsData.class);
if (existing != null) {
resourceSet.eAdapters().remove(existing);
}
ResourceDescriptionsData.ResourceSetAdapter.installResourceDescriptionsData(resourceSet, index);
}
use of org.eclipse.n4js.resource.OrderedResourceDescriptionsData in project n4js by eclipse.
the class N4HeadlessCompiler method createResourceSet.
/**
* Creates the common resource set to use during compilation. Installs a light weight index.
*
* @return the resource set
*/
private ResourceSet createResourceSet() {
// TODO try to reuse code from IN4JSCore.createResourceSet
XtextResourceSet resourceSet = xtextResourceSetProvider.get();
resourceSet.setClasspathURIContext(classLoader);
// Install containerState as adapter.
resourceSet.eAdapters().add(new DelegatingIAllContainerAdapter(rsbAcs));
// Install a lightweight index.
OrderedResourceDescriptionsData index = new OrderedResourceDescriptionsData(Collections.emptyList());
ResourceDescriptionsData.ResourceSetAdapter.installResourceDescriptionsData(resourceSet, index);
return resourceSet;
}
Aggregations