use of org.eclipse.xtext.ui.testing.util.ResourceLoadHelper in project n4js by eclipse.
the class N4ContentAssistProcessorTestBuilderHelper method createTestBuilderForResource.
/**
* @param resource
* the resource under test
* @return the configured content assist test builder (resource set and resource content appended).
* @throws Exception
* some exception
*/
public N4ContentAssistProcessorTestBuilder createTestBuilderForResource(XtextResource resource) throws Exception {
N4ContentAssistProcessorTestBuilder fixture = testBuilder.create(new ResourceLoadHelper() {
@Override
public XtextResource getResourceFor(InputStream stream) {
return XtextResourceCleanUtil.cleanXtextResource(resource);
}
});
fixture = fixture.append(resource.getParseResult().getRootNode().getText());
return fixture;
}
Aggregations