use of io.typefox.lsapi.impl.LocationImpl in project che by eclipse.
the class TextDocumentService method definition.
@POST
@Path("definition")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public List<? extends Location> definition(TextDocumentPositionParamsDTO params) throws ExecutionException, InterruptedException, LanguageServerException {
params.getTextDocument().setUri(prefixURI(params.getTextDocument().getUri()));
LanguageServer server = getServer(params.getTextDocument().getUri());
if (server == null) {
return emptyList();
}
List<? extends Location> locations = server.getTextDocumentService().definition(params).get();
locations.forEach(o -> {
if (o instanceof LocationImpl) {
((LocationImpl) o).setUri(removePrefixUri(o.getUri()));
}
});
return locations;
}
use of io.typefox.lsapi.impl.LocationImpl in project che by eclipse.
the class WorkspaceService method documentSymbol.
@POST
@Path("symbol")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public List<? extends SymbolInformation> documentSymbol(WorkspaceSymbolParamsDTO workspaceSymbolParams) throws ExecutionException, InterruptedException, LanguageServerException {
LanguageServer server = getServer(TextDocumentService.prefixURI(workspaceSymbolParams.getFileUri()));
if (server == null) {
return emptyList();
}
List<? extends SymbolInformation> informations = server.getWorkspaceService().symbol(workspaceSymbolParams).get();
informations.forEach(o -> {
Location location = o.getLocation();
if (location instanceof LocationImpl) {
((LocationImpl) location).setUri(TextDocumentService.removePrefixUri(location.getUri()));
}
});
return informations;
}
use of io.typefox.lsapi.impl.LocationImpl in project che by eclipse.
the class TextDocumentService method references.
@POST
@Path("references")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public List<? extends Location> references(ReferenceParamsDTO params) throws ExecutionException, InterruptedException, LanguageServerException {
params.getTextDocument().setUri(prefixURI(params.getTextDocument().getUri()));
LanguageServer server = getServer(params.getTextDocument().getUri());
if (server == null) {
return emptyList();
}
List<? extends Location> locations = server.getTextDocumentService().references(params).get();
locations.forEach(o -> {
if (o instanceof LocationImpl) {
((LocationImpl) o).setUri(removePrefixUri(o.getUri()));
}
});
return locations;
}
Aggregations