blob: c7b8108db567e5c842dd4bfceca0bed4f780fbf1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package tools.refinery.language.web.xtext.server.push;
import org.eclipse.xtext.web.server.IServiceContext;
import org.eclipse.xtext.web.server.XtextServiceDispatcher;
import org.eclipse.xtext.web.server.model.XtextWebDocument;
import com.google.inject.Singleton;
import tools.refinery.language.web.xtext.server.SubscribingServiceContext;
@Singleton
public class PushServiceDispatcher extends XtextServiceDispatcher {
@Override
protected XtextWebDocument getFullTextDocument(String fullText, String resourceId, IServiceContext context) {
var document = super.getFullTextDocument(fullText, resourceId, context);
if (document instanceof PushWebDocument pushWebDocument
&& context instanceof SubscribingServiceContext subscribingContext) {
pushWebDocument.addPrecomputationListener(subscribingContext.subscriber());
}
return document;
}
}
|