use of javax.ws.rs.POST in project che by eclipse.
the class TextDocumentService method formatting.
@POST
@Path("formatting")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public List<? extends TextEdit> formatting(DocumentFormattingParamsDTO 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().formatting(params).get();
}
use of javax.ws.rs.POST in project che by eclipse.
the class TextDocumentService method hover.
@POST
@Path("hover")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Hover hover(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().hover(positionParams).get();
} else {
return null;
}
}
use of javax.ws.rs.POST in project che by eclipse.
the class TextDocumentService method didClose.
@POST
@Path("didClose")
@Consumes(MediaType.APPLICATION_JSON)
public void didClose(DidCloseTextDocumentParamsDTO closeEvent) throws LanguageServerException {
closeEvent.getTextDocument().setUri(prefixURI(closeEvent.getTextDocument().getUri()));
LanguageServer server = getServer(closeEvent.getTextDocument().getUri());
if (server != null) {
server.getTextDocumentService().didClose(closeEvent);
}
}
use of javax.ws.rs.POST in project che by eclipse.
the class TextDocumentService method documentSymbol.
@POST
@Path("documentSymbol")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public List<? extends SymbolInformation> documentSymbol(DocumentSymbolParamsDTO documentSymbolParams) throws ExecutionException, InterruptedException, LanguageServerException {
documentSymbolParams.getTextDocument().setUri(prefixURI(documentSymbolParams.getTextDocument().getUri()));
LanguageServer server = getServer(documentSymbolParams.getTextDocument().getUri());
if (server == null) {
return emptyList();
}
return server.getTextDocumentService().documentSymbol(documentSymbolParams).get();
}
use of javax.ws.rs.POST 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;
}
Aggregations