Search in sources :

Example 1 with IDocumentHighlightService

use of org.eclipse.xtext.ide.server.occurrences.IDocumentHighlightService in project xtext-core by eclipse.

the class LanguageServerImpl method documentHighlight.

/**
 * Compute the document highlights. Executed in a read request.
 * @since 2.20
 */
protected List<? extends DocumentHighlight> documentHighlight(DocumentHighlightParams params, CancelIndicator cancelIndicator) {
    URI uri = getURI(params);
    IDocumentHighlightService service = getService(uri, IDocumentHighlightService.class);
    if (service == null) {
        return Collections.emptyList();
    }
    return workspaceManager.doRead(uri, (doc, resource) -> service.getDocumentHighlights(doc, resource, params, cancelIndicator));
}
Also used : IDocumentHighlightService(org.eclipse.xtext.ide.server.occurrences.IDocumentHighlightService) URI(org.eclipse.emf.common.util.URI)

Aggregations

URI (org.eclipse.emf.common.util.URI)1 IDocumentHighlightService (org.eclipse.xtext.ide.server.occurrences.IDocumentHighlightService)1