use of org.eclipse.xtext.util.BufferedCancelIndicator in project xtext-core by eclipse.
the class LanguageServerImpl method completion.
/**
* Compute the completion items.
*/
protected Either<List<CompletionItem>, CompletionList> completion(CancelIndicator originalCancelIndicator, CompletionParams params) {
URI uri = getURI(params);
ContentAssistService contentAssistService = getService(uri, ContentAssistService.class);
if (contentAssistService == null) {
return Either.forRight(new CompletionList());
}
BufferedCancelIndicator cancelIndicator = new BufferedCancelIndicator(originalCancelIndicator);
return Either.forRight(workspaceManager.doRead(uri, (doc, res) -> contentAssistService.createCompletionList(doc, res, params, cancelIndicator)));
}
Aggregations