use of org.eclipse.xtext.resource.impl.ChunkedResourceDescriptions in project xtext-core by eclipse.
the class AbstractIncrementalBuilderTest method newBuildRequest.
protected BuildRequest newBuildRequest(Procedure1<? super BuildRequest> init) {
BuildRequest result = new BuildRequest();
ResourceDescriptionsData newIndex = indexState.getResourceDescriptions().copy();
result.setBaseDir(uri(""));
XtextResourceSet rs = resourceSetProvider.get();
rs.getURIConverter().getURIHandlers().clear();
rs.getURIConverter().getURIHandlers().add(inMemoryURIHandler);
rs.setClasspathURIContext(AbstractIncrementalBuilderTest.class.getClassLoader());
ProjectDescription projectDescription = new ProjectDescription();
projectDescription.setName("test-project");
projectDescription.attachToEmfObject(rs);
ChunkedResourceDescriptions index = new ChunkedResourceDescriptions(Collections.emptyMap(), rs);
index.setContainer(projectDescription.getName(), newIndex);
result.setResourceSet(rs);
result.setDirtyFiles(new ArrayList<>());
result.setDeletedFiles(new ArrayList<>());
result.setAfterValidate((uri, issues) -> {
Iterables.addAll(this.issues, issues);
return Iterables.isEmpty(issues);
});
result.setAfterDeleteFile(f -> deleted.add(f));
result.setAfterGenerateFile((source, target) -> generated.put(source, target));
result.setState(new IndexState(newIndex, indexState.getFileMappings().copy()));
init.apply(result);
return result;
}
use of org.eclipse.xtext.resource.impl.ChunkedResourceDescriptions in project xtext-core by eclipse.
the class ProjectDescriptionBasedContainerManager method getVisibleContainers.
@Override
public List<IContainer> getVisibleContainers(IResourceDescription desc, IResourceDescriptions resourceDescriptions) {
ChunkedResourceDescriptions descriptions = getChunkedResourceDescriptions(resourceDescriptions);
if (descriptions == null)
throw new IllegalArgumentException("Expected " + ChunkedResourceDescriptions.class.getName());
ProjectDescription projectDescription = ProjectDescription.findInEmfObject(descriptions.getResourceSet());
List<IContainer> allContainers = new ArrayList<>();
allContainers.add(createContainer(resourceDescriptions, descriptions, projectDescription.getName()));
for (String name : projectDescription.getDependencies()) allContainers.add(createContainer(resourceDescriptions, descriptions, name));
return allContainers;
}
Aggregations