use of org.eclipse.xtext.linking.lazy.LazyLinkingResource in project xtext-core by eclipse.
the class XtextValidationTest method getResourceFromString.
protected XtextResource getResourceFromString(String model, String uriString, XtextResourceSet rs) throws IOException {
rs.setClasspathURIContext(getClasspathURIContext());
XtextResource resource = (XtextResource) getResourceFactory().createResource(URI.createURI(uriString));
rs.getResources().add(resource);
resource.load(getAsStream(model), null);
if (resource instanceof LazyLinkingResource) {
((LazyLinkingResource) resource).resolveLazyCrossReferences(CancelIndicator.NullImpl);
} else {
EcoreUtil.resolveAll(resource);
}
return resource;
}
Aggregations