use of io.typefox.lsapi.services.LanguageServer 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;
}
use of io.typefox.lsapi.services.LanguageServer in project che by eclipse.
the class TextDocumentService method completion.
@POST
@Path("completion")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public CompletionList completion(TextDocumentPositionParamsDTO textDocumentPositionParams) throws InterruptedException, ExecutionException, LanguageServerException {
textDocumentPositionParams.getTextDocument().setUri(prefixURI(textDocumentPositionParams.getTextDocument().getUri()));
textDocumentPositionParams.setUri(prefixURI(textDocumentPositionParams.getUri()));
LanguageServer server = getServer(textDocumentPositionParams.getTextDocument().getUri());
if (server == null) {
return null;
}
return server.getTextDocumentService().completion(textDocumentPositionParams).get();
}
use of io.typefox.lsapi.services.LanguageServer in project che by eclipse.
the class TextDocumentService method rangeFormatting.
@POST
@Path("rangeFormatting")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public List<? extends TextEdit> rangeFormatting(DocumentRangeFormattingParamsDTO params) throws InterruptedException, ExecutionException, LanguageServerException {
params.getTextDocument().setUri(prefixURI(params.getTextDocument().getUri()));
LanguageServer server = getServer(params.getTextDocument().getUri());
if (server == null) {
return emptyList();
}
return server.getTextDocumentService().rangeFormatting(params).get();
}
use of io.typefox.lsapi.services.LanguageServer in project che by eclipse.
the class TextDocumentService method didSave.
@POST
@Path("didSave")
@Consumes(MediaType.APPLICATION_JSON)
public void didSave(DidSaveTextDocumentParamsDTO saveEvent) throws LanguageServerException {
saveEvent.getTextDocument().setUri(prefixURI(saveEvent.getTextDocument().getUri()));
LanguageServer server = getServer(saveEvent.getTextDocument().getUri());
if (server != null) {
server.getTextDocumentService().didSave(saveEvent);
}
}
use of io.typefox.lsapi.services.LanguageServer in project che by eclipse.
the class TextDocumentService method signatureHelp.
@POST
@Path("signatureHelp")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public SignatureHelp signatureHelp(TextDocumentPositionParamsDTO positionParams) throws LanguageServerException, ExecutionException, InterruptedException {
positionParams.getTextDocument().setUri(prefixURI(positionParams.getTextDocument().getUri()));
positionParams.setUri(prefixURI(positionParams.getUri()));
LanguageServer server = getServer(positionParams.getTextDocument().getUri());
if (server != null) {
return server.getTextDocumentService().signatureHelp(positionParams).get();
} else {
return null;
}
}
Aggregations