Search in sources :

Example 1 with IDocumentSymbolService

use of org.eclipse.xtext.ide.server.symbol.IDocumentSymbolService in project xtext-core by eclipse.

the class LanguageServerImpl method documentSymbol.

/**
 * Compute the symbol information. Executed in a read request.
 * @since 2.20
 */
protected List<Either<SymbolInformation, DocumentSymbol>> documentSymbol(DocumentSymbolParams params, CancelIndicator cancelIndicator) {
    URI uri = getURI(params.getTextDocument());
    IDocumentSymbolService documentSymbolService = getIDocumentSymbolService(getResourceServiceProvider(uri));
    if (documentSymbolService == null) {
        return Collections.emptyList();
    }
    return workspaceManager.doRead(uri, (document, resource) -> documentSymbolService.getSymbols(document, resource, params, cancelIndicator));
}
Also used : IDocumentSymbolService(org.eclipse.xtext.ide.server.symbol.IDocumentSymbolService) URI(org.eclipse.emf.common.util.URI)

Aggregations

URI (org.eclipse.emf.common.util.URI)1 IDocumentSymbolService (org.eclipse.xtext.ide.server.symbol.IDocumentSymbolService)1