Search in sources :

Example 1 with FoldingRangeService

use of org.eclipse.xtext.ide.server.folding.FoldingRangeService in project xtext-core by eclipse.

the class LanguageServerImpl method foldingRange.

/**
 * @since 2.26
 */
protected List<FoldingRange> foldingRange(FoldingRangeRequestParams params, CancelIndicator cancelIndicator) {
    URI uri = getURI(params.getTextDocument());
    FoldingRangeService foldingRangeService = getService(uri, FoldingRangeService.class);
    if (foldingRangeService == null) {
        return Lists.newArrayList();
    }
    return workspaceManager.doRead(uri, (document, resource) -> foldingRangeService.createFoldingRanges(document, resource, cancelIndicator));
}
Also used : URI(org.eclipse.emf.common.util.URI) FoldingRangeService(org.eclipse.xtext.ide.server.folding.FoldingRangeService)

Aggregations

URI (org.eclipse.emf.common.util.URI)1 FoldingRangeService (org.eclipse.xtext.ide.server.folding.FoldingRangeService)1