use of org.eclipse.che.api.languageserver.shared.lsapi.SignatureHelpDTO in project che by eclipse.
the class LanguageServerSignatureHelp method signatureHelp.
@Override
public Promise<Optional<SignatureHelp>> signatureHelp(Document document, int offset) {
TextDocumentPositionParamsDTO paramsDTO = helper.createTDPP(document, offset);
Promise<SignatureHelpDTO> promise = client.signatureHelp(paramsDTO);
return promise.then(new Function<SignatureHelpDTO, Optional<SignatureHelp>>() {
@Override
public Optional<SignatureHelp> apply(SignatureHelpDTO arg) throws FunctionException {
if (arg == null) {
return Optional.absent();
}
return Optional.<SignatureHelp>of(new SignatureHelpImpl(arg));
}
}).catchError(new Function<PromiseError, Optional<SignatureHelp>>() {
@Override
public Optional<SignatureHelp> apply(PromiseError arg) throws FunctionException {
notificationManager.notify(arg.getMessage(), StatusNotification.Status.FAIL, StatusNotification.DisplayMode.EMERGE_MODE);
return Optional.absent();
}
});
}
Aggregations