use of org.eclipse.xtext.build.BuildContext in project xtext-core by eclipse.
the class IncrementalBuilder method build.
public IncrementalBuilder.Result build(final BuildRequest request, final Function1<? super URI, ? extends IResourceServiceProvider> languages, final IResourceClusteringPolicy clusteringPolicy) {
try {
final XtextResourceSet resourceSet = request.getResourceSet();
ResourceDescriptionsData _copy = request.getState().getResourceDescriptions().copy();
Source2GeneratedMapping _copy_1 = request.getState().getFileMappings().copy();
final IndexState oldState = new IndexState(_copy, _copy_1);
CancelIndicator _cancelIndicator = request.getCancelIndicator();
final BuildContext context = new BuildContext(languages, resourceSet, oldState, clusteringPolicy, _cancelIndicator);
final IncrementalBuilder.InternalStatefulIncrementalBuilder builder = this.provider.get();
builder.context = context;
builder.request = request;
try {
return builder.launch();
} catch (final Throwable _t) {
if (_t instanceof Throwable) {
final Throwable t = (Throwable) _t;
this._operationCanceledManager.propagateIfCancelException(t);
throw t;
} else {
throw Exceptions.sneakyThrow(_t);
}
}
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations