Search in sources :

Example 21 with Consumes

use of javax.ws.rs.Consumes 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;
    }
}
Also used : LanguageServer(io.typefox.lsapi.services.LanguageServer) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces)

Example 22 with Consumes

use of javax.ws.rs.Consumes 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);
    }
}
Also used : LanguageServer(io.typefox.lsapi.services.LanguageServer) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes)

Example 23 with Consumes

use of javax.ws.rs.Consumes 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();
}
Also used : LanguageServer(io.typefox.lsapi.services.LanguageServer) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces)

Example 24 with Consumes

use of javax.ws.rs.Consumes 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;
}
Also used : LanguageServer(io.typefox.lsapi.services.LanguageServer) LocationImpl(io.typefox.lsapi.impl.LocationImpl) Location(io.typefox.lsapi.Location) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes) Produces(javax.ws.rs.Produces)

Example 25 with Consumes

use of javax.ws.rs.Consumes in project che by eclipse.

the class TextDocumentService method documentHighlight.

@POST
@Path("documentHighlight")
@Consumes(MediaType.APPLICATION_JSON)
public DocumentHighlight documentHighlight(TextDocumentPositionParamsDTO positionParams) throws LanguageServerException, InterruptedException, ExecutionException {
    positionParams.getTextDocument().setUri(prefixURI(positionParams.getTextDocument().getUri()));
    LanguageServer server = getServer(positionParams.getTextDocument().getUri());
    if (server != null) {
        return server.getTextDocumentService().documentHighlight(positionParams).get();
    }
    return null;
}
Also used : LanguageServer(io.typefox.lsapi.services.LanguageServer) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) Consumes(javax.ws.rs.Consumes)

Aggregations

Consumes (javax.ws.rs.Consumes)1565 Path (javax.ws.rs.Path)1221 Produces (javax.ws.rs.Produces)1217 POST (javax.ws.rs.POST)892 ApiOperation (io.swagger.annotations.ApiOperation)503 ApiResponses (io.swagger.annotations.ApiResponses)445 PUT (javax.ws.rs.PUT)417 GET (javax.ws.rs.GET)223 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)215 URI (java.net.URI)202 IOException (java.io.IOException)147 WebApplicationException (javax.ws.rs.WebApplicationException)139 Response (javax.ws.rs.core.Response)136 ArrayList (java.util.ArrayList)134 Authorizable (org.apache.nifi.authorization.resource.Authorizable)100 DELETE (javax.ws.rs.DELETE)86 TimedResource (org.killbill.commons.metrics.TimedResource)84 CallContext (org.killbill.billing.util.callcontext.CallContext)83 Timed (com.codahale.metrics.annotation.Timed)78 HashMap (java.util.HashMap)76