use of org.eclipse.n4js.xtext.ide.server.build.XBuildRequest in project n4js by eclipse.
the class N4JSProjectBuilder method newBuildRequest.
@Override
protected XBuildRequest newBuildRequest(IBuildRequestFactory buildRequestFactory, Set<URI> changedFiles, Set<URI> deletedFiles, List<Delta> externalDeltas, CancelIndicator cancelIndicator) {
XBuildRequest request = super.newBuildRequest(buildRequestFactory, changedFiles, deletedFiles, externalDeltas, cancelIndicator);
ProjectDescription pd = getProjectConfig().getProjectDescription();
if (N4JSLanguageUtils.isDtsGenerationActive(pd)) {
request.addAfterBuildRequestListener(new DtsAfterBuildListener(getProjectConfig()));
}
request.addAfterBuildFileListener((uri) -> {
Resource resource = getResource(uri);
if (resource instanceof N4JSResource) {
N4JSResource n4jsResource = (N4JSResource) resource;
ASTFlowInfo flowInfo = n4jsResource.getASTMetaInfoCache().getFlowInfo();
// release memory
flowInfo.reset();
n4jsResource.unloadAST();
}
});
return request;
}
Aggregations